diff options
Diffstat (limited to 'lib_generic/vsprintf.c')
-rw-r--r-- | lib_generic/vsprintf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib_generic/vsprintf.c b/lib_generic/vsprintf.c index 8c58a9366..3b282f130 100644 --- a/lib_generic/vsprintf.c +++ b/lib_generic/vsprintf.c @@ -133,6 +133,15 @@ static int skip_atoi(const char **s) return i; } +int atoi(const char *s) +{ + int i=0; + + while (is_digit(*s)) + i = i*10 + *(s++) - '0'; + return i; +} + /* Decimal conversion is by far the most typical, and is used * for /proc and /sys data. This directly impacts e.g. top performance * with many processes running. We optimize it for speed |