Bug 387

Summary: Missing braces in code
Product: fontconfig Reporter: Pedro Gimeno <usr352>
Component: libraryAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: high    
Version: 2.2   
Hardware: x86 (IA32)   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Pedro Gimeno 2004-03-30 04:28:27 UTC
Looking at the differences between FC 2.2.1 and 2.2.2 I've found this snippet:

--- fontconfig-2.2.1/src/fcxml.c        2003-04-16 01:38:06.000000000 +0200
+++ fontconfig-2.2.2/src/fcxml.c        2003-11-10 19:10:15.000000000 +0100
@@ -963,6 +963,8 @@ FcStrtod (char *s, char **end)
            v = strtod (buf, &buf_end);
            if (buf_end)
                buf_end = s + (buf_end - buf);
+               if (buf_end > dot)
+                   buf_end -= dlen - 1;
            if (end)
                *end = buf_end;
        }

Note the lack of braces around the sentences within the IF. It seems to work
just by luck (unless 'dot' can be negative for some reason but I don't think
that's possible).
Comment 1 Keith Packard 2004-03-30 09:18:54 UTC
Good catch.  I checked HEAD and found that it already had braces around that
block.  This "shouldn't" cause any failures though on most machines as a null
pointer is generally "less" than any non-null pointer.  I  fixed the bug, but
I'm not planning on cutting another release for it.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.