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



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