Am 15.04.16 um 18:41 schrieb Selva Nair:
> 
> On Fri, Apr 15, 2016 at 8:59 AM, Arne Schwabe <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     Am 14.04.16 um 19:58 schrieb Jens:
>     > Hi,
>     >
>     > please review the following patch for a compiler warning on MacOS X. 
> The program logic is unchanged.
>     Thanks for the patch.
>     Program logic is unchanged and the patch is fine but reading the fixed
>     code is more difficult.
> 
>     Instead of error of if not A you have now need to stare bit more to get
>     that meaning.
> 
> 
> I disagree.
> 
> Although if ( !strcmp() ) is a common usage in C, ( !srtcmp() == 0 ) is
> not, and such double negatives are best avoided. strcmp() == 0 and
> strcmp() != 0 are easily understood by C-programmers. 
> 
> As for the scanf line, the original is
> 
> if (!sscanf (dev_node, "utun%d", &utunnum)==1)
> 
> Here sscanf can potentially return EOF or 0 for failure or 1 for
> success, but the test catches only 0. EOF can result if dev_node == ""
> or "tun", so probably unlikely (?) because of previous checks. In any
> case. the intent appears to be to catch sscanf() != 1. And the latter is
> much better and easier to read.
> 
> If its only a question of style, the patch clearly improves the unusual
> usage in the original, imo.

Fine. I am not going to nitpick here. Lets just say ACK to the original
patch as it fixes the compiler warnings.

Arne


Reply via email to