From c6218dbae579de0cd20f5a7f1e9877673e28225d Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 20 Dec 2000 22:52:58 +0000 Subject: A number of updates from Manuel Novoa III. Things look good... --- libc/misc/assert/__assert.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'libc/misc/assert/__assert.c') diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c index 905671d98..b98958f43 100644 --- a/libc/misc/assert/__assert.c +++ b/libc/misc/assert/__assert.c @@ -3,11 +3,24 @@ * under the GNU Library General Public License. */ +/* + * Manuel Novoa III Dec 2000 + * + * Converted to use my new (un)signed long (long) to string routines, which + * are smaller than the previous functions and don't require static buffers. + */ + #include #include #include +#include -extern char *itoa(int); +#if (INT_MAX >> 31) +/* We're set up for 32 bit ints */ +#error need to check size allocation for buffer 'buf' +#endif + +extern char *__ltostr(char *buf, unsigned long uval, int base, int uppercase); static void errput(str) const char *str; @@ -21,9 +34,11 @@ const char *filename; int linenumber; const char *function; { + char buf[12]; + errput(filename); errput(":"); - errput(itoa(linenumber)); + errput(__ltostr(buf + sizeof(buf) - 1, linenumber, 10, 0)); errput(function ? ": " : ""); errput(function ? function : ""); errput(function ? "() " : ""); -- cgit v1.2.3