probably little bug in printk

Francesco Poletti fpoletti at libero.it
Thu Nov 28 09:39:22 UTC 2002


Hy,
   while I was trying to resolve my integer printf problem I looked at
printk, a really useful function, I saw this code and I think that have
a little bug.
while (*fmt >= '0' && *fmt <= '9' ) {
        width *= 10;
        width += (*fmt - '0');
        fmt++;
      }

Width is the conversion of string (.0n) in a number. I have done this
change and now seem work:
  base1=1;
   while (*fmt >= '0' && *fmt <= '9' ) {
        
        width += ((*fmt - '0')*base1);
        fmt++;
        base1 *= 10;
      }

 This is not a big problemen, but however I think is a little bug;
probably noone have used printk setting .0n options with n bigger then
9.
 
Thanks to all Francesco




More information about the users mailing list