diff --git a/js/src/js.c b/js/src/js.c index 30f6eda30dba..08834537fc2e 100644 --- a/js/src/js.c +++ b/js/src/js.c @@ -1518,6 +1518,7 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) { int i, j, k, n; char *prefix = NULL, *tmp; + const char *ctmp; if (!report) { fprintf(gErrFile, "%s\n", message); @@ -1542,11 +1543,11 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) } /* embedded newlines -- argh! */ - while ((tmp = strchr(message, '\n')) != 0) { - tmp++; + while ((ctmp = strchr(message, '\n')) != 0) { + ctmp++; if (prefix) fputs(prefix, gErrFile); - fwrite(message, 1, tmp - message, gErrFile); - message = tmp; + fwrite(message, 1, ctmp - message, gErrFile); + message = ctmp; } /* If there were no filename or lineno, the prefix might be empty */ if (prefix) diff --git a/js/src/xpconnect/shell/xpcshell.cpp b/js/src/xpconnect/shell/xpcshell.cpp index 33143a8f5e60..97754ea94ab3 100644 --- a/js/src/xpconnect/shell/xpcshell.cpp +++ b/js/src/xpconnect/shell/xpcshell.cpp @@ -101,6 +101,7 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) { int i, j, k, n; char *prefix = NULL, *tmp; + const char *ctmp; if (!report) { fprintf(gErrFile, "%s\n", message); @@ -121,11 +122,11 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) } /* embedded newlines -- argh! */ - while ((tmp = strchr(message, '\n')) != 0) { - tmp++; + while ((ctmp = strchr(message, '\n')) != 0) { + ctmp++; if (prefix) fputs(prefix, gErrFile); - fwrite(message, 1, tmp - message, gErrFile); - message = tmp; + fwrite(message, 1, ctmp - message, gErrFile); + message = ctmp; } /* If there were no filename or lineno, the prefix might be empty */ if (prefix)