Change 19833 by [EMAIL PROTECTED] on 2003/06/20 08:16:02

        Don't do sprintf().

Affected files ...

... //depot/perl/malloc.c#99 edit

Differences ...

==== //depot/perl/malloc.c#99 (text) ====
Index: perl/malloc.c
--- perl/malloc.c#98~19832~     Fri Jun 20 00:43:48 2003
+++ perl/malloc.c       Fri Jun 20 01:16:02 2003
@@ -1269,8 +1269,6 @@
        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 @@
            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();
End of Patch.

Reply via email to