diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-20 08:16:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-20 08:16:02 +0000 |
commit | 6bf964e1a60fa5bb711b214d387c6f288b402685 (patch) | |
tree | 7610e2c4e46a548fb1b27e759a91a35d43f5df28 /malloc.c | |
parent | 066d1a89330dfaa74b5c19223bbd3a266ca4fab3 (diff) | |
download | perl-6bf964e1a60fa5bb711b214d387c6f288b402685.tar.gz |
Don't do sprintf().
p4raw-id: //depot/perl@19833
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1269,8 +1269,6 @@ botch(char *diag, char *s, char *file, int line) goto do_write; else { dTHX; - char linebuf[10]; - if (PerlIO_printf(PerlIO_stderr(), "assertion botched (%s?): %s%s %s:%d\n", diag, s, file, line) != 0) { @@ -1282,8 +1280,16 @@ botch(char *diag, char *s, char *file, int line) write2(" ("); write2(file); write2(":"); - sprintf(linebuf, "%d", line); - write2(linebuf); + { + char linebuf[10]; + char *s = linebuf + sizeof(linebuf) - 1; + int n = line; + *s = 0; + do { + *--s = '0' + (n % 10); + } while (n /= 10); + write2(s); + } write2(")\n"); } PerlProc_abort(); |