NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/48815: mount_cd9660 option -o "norrip,gens" is quite unusable



The following reply was made to PR kern/48815; it has been noted by GNATS.

From: Wolfgang Solfrank <Wolfgang%Solfrank.net@localhost>
To: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost, 
 gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/48815: mount_cd9660 option -o "norrip,gens" is quite unusable
Date: Sat, 17 May 2014 18:09:34 +0200

 Hi,
 
 while your are correct on this:
 
 > It increments fn, obviously to skip the semicolon. But this has been
 > done already by the call to static int wget() which produced the
 > 16 bit variable which beared the semicolon.
 
 I'm unsure on what you are talking about here:
 
 > Further, the third statement in for() increments fn again, before
 > the loop body can compare it with the digit range of ASCII.
 
 as your proposed fix:
 
 >          for (i = 0; fnlen-- != 0; fn++) {
 >                  if (*fn < '0' || *fn > '9')
 >                          return -1;
 >                  i = i * 10 + *fn - '0';
 >          }
 
 it totally equivalent to the original code:
 
  >          for (i = 0; fnlen-- != 0; i = i * 10 + *fn++ - '0') {
  >                  if (*fn < '0' || *fn > '9') {
  >                          return -1;
  >                  }
  >          }
 
 Ciao,
 Wolfgang
 -- 
 Wolfgang%Solfrank.net@localhost                                Wolfgang 
Solfrank
 


Home | Main Index | Thread Index | Old Index