[Patch] fix unsigned long fast_strtoul_10(char **endptr) for Linux 2.4
Denys Vlasenko
vda.linux at googlemail.com
Tue Feb 28 02:38:51 UTC 2012
On Monday 27 February 2012 18:56, walter harms wrote:
> Hi list,
> Enabling the fast proc scan code for linux2.4 causes top
> to display strange numbers [see:possible bug in proc fast scan code]
>
> the reason for this is that the last char in proc/$$/stat is "\n".
> This is no problem for > 2.4 since the stats line contains additional chars.
>
> Please be aware that the current code does NOT stop at \0 ! adding more
> tokens to read will cause the code to read beyond \0 !
Thanks for diagnosing the problem!
> i also killed the variable c what saves 1 byte.
...and introduced a bug: you are using str[0] twice now.
I fixed the code in current git. Please try it.
--
vda
More information about the busybox
mailing list