diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
commit | 78c388aed2b7184182c08428db1de6c872d815f5 (patch) | |
tree | 4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /lib/vsprintf.c | |
parent | eb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff) |
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index b2e72d584..b42b01b11 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -39,6 +39,13 @@ unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) return result; } +long simple_strtol(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoul(cp+1,endp,base); + return simple_strtoul(cp,endp,base); +} + /* we use this so that we can do without the ctype library */ #define is_digit(c) ((c) >= '0' && (c) <= '9') @@ -283,10 +290,9 @@ int vsprintf(char *buf, const char *fmt, va_list args) if (qualifier == 'l') num = va_arg(args, unsigned long); else if (qualifier == 'h') { + num = (unsigned short) va_arg(args, int); if (flags & SIGN) - num = va_arg(args, short); - else - num = va_arg(args, unsigned short); + num = (short) num; } else if (flags & SIGN) num = va_arg(args, int); else |