[PATCH 05/32] [libx11] Pointer "pBuf" returned from "fgets(buf, 256, stream)" is never used

Erkki Seppala erkki.seppala at vincit.fi
Thu Jan 27 23:48:33 PST 2011


On 27.01.2011 18:32, Matt Turner wrote:
>> -    while((pBuf = fgets(buf, XCMSDB_MAXLINELEN, stream)) != NULL) {
>> +    while((fgets(buf, XCMSDB_MAXLINELEN, stream)) != NULL) {
>
> I'd think the reason the code is like this is to avoid warning messages like
>
> warning: ignoring return value of ‘fgets’, declared with attribute
> warn_unused_result
>
> So, this may not be what you want to do.

But, its result is used, when it's compared against NULL?

(But the parenthesis that were left there after the fix seem superfluous.)


More information about the xorg-devel mailing list