From: Alan Cox Date: Mon, 29 Dec 2014 21:55:51 +0000 (+0000) Subject: vfprintf: fix confusion about ltoa and ltostr X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=52487c2b124e1b50d8888163f00a1ceca54199f2;p=FUZIX.git vfprintf: fix confusion about ltoa and ltostr --- diff --git a/Library/include/stdlib.h b/Library/include/stdlib.h index 5fa53591..4b6623ba 100644 --- a/Library/include/stdlib.h +++ b/Library/include/stdlib.h @@ -46,8 +46,8 @@ extern char *_itoa __P((int value)); extern char *_ltoa __P((long value)); extern char *_ultoa __P((unsigned long value)); -extern char *ultostr __P((unsigned long value, int radix)); -extern char *ltostr __P((long value, int radix)); +extern char *ultostr __P((unsigned long value, char *buf, int radix)); +extern char *ltostr __P((long value, char *buf, int radix)); extern long strtol __P ((const char * nptr, char ** endptr, int base)); extern unsigned long strtoul __P ((const char * nptr, diff --git a/Library/libs/vfprintf.c b/Library/libs/vfprintf.c index 4eebc70d..2163a73e 100644 --- a/Library/libs/vfprintf.c +++ b/Library/libs/vfprintf.c @@ -148,7 +148,7 @@ int vfprintf(FILE * op, char *fmt, va_list ap) case 'd': /* Signed decimal */ case 'i': - ptmp = ltoa((long) ((lval) ? + ptmp = ltostr((long) ((lval) ? va_arg(ap, long) : va_arg(ap, short)), tmp, 10); @@ -181,7 +181,7 @@ int vfprintf(FILE * op, char *fmt, va_list ap) usproc:val = lval ? va_arg(ap, unsigned long) : va_arg(ap, unsigned short); - ptmp = ultoa(val, tmp + 4, radix); + ptmp = ultostr(val, tmp + 4, radix); add = ""; if (hash) { if (radix == 2)