libX11: Changes to 'master'
Alan Coopersmith
alanc at kemper.freedesktop.org
Fri Oct 25 09:28:06 PDT 2013
src/xcms/cmsColNm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 6cb02b166361200da35ba14f52cd9aaa493eb0ea
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date: Wed Oct 23 10:37:53 2013 -0700
Xcms file parsing should not require the impossible to succeed
The field2 helper function, to split lines from Xcms.txt files into
two tab delimited fields, contained a check:
if ((*pBuf != '\n') || (*pBuf != '\0')) {
return(XcmsFailure);
which would cause it to return failure unless *pBuf had a value that
was simultaneously equal to both \n & \0, and no one wants to live in
a world where that could ever be true.
This has gone unnoticed since 1991, since this only caused lines
in Xcms.txt that started with whitespace to be rejected, but now
gcc -Wlogicalop has brought it to our attention, and
https://bugs.freedesktop.org/show_bug.cgi?id=70803 was filed.
Now that we see it, and cannot unsee it, we change it to use the
same logic as the check at other points in this function, to return
failure only if we hit \n or \0 before we find the first non-whitespace
character, so that lines starting with whitespace will have the space
skipped over to get to the color name to be defined.
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
More information about the xorg-commit
mailing list