mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-04 07:14:52 +00:00
checking in code to fix bug 12768 submitted by Dan.Oscarsson@trab.se. Needed a 'const char*' tmp varible to work with a 'const char*' buffer that was passed in. The same problem is in both js.c and xpcshell.cpp. r=jband
This commit is contained in:
parent
8cf6cf4767
commit
63c50e078a
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user