summaryrefslogtreecommitdiff
path: root/libc/misc/assert
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/assert')
-rw-r--r--libc/misc/assert/__assert.c19
1 files changed, 17 insertions, 2 deletions
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 <unistd.h>
#include <string.h>
#include <stdlib.h>
+#include <limits.h>
-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 ? "() " : "");