зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
8cf6cf4767
Коммит
63c50e078a
|
@ -1518,6 +1518,7 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
|
||||||
{
|
{
|
||||||
int i, j, k, n;
|
int i, j, k, n;
|
||||||
char *prefix = NULL, *tmp;
|
char *prefix = NULL, *tmp;
|
||||||
|
const char *ctmp;
|
||||||
|
|
||||||
if (!report) {
|
if (!report) {
|
||||||
fprintf(gErrFile, "%s\n", message);
|
fprintf(gErrFile, "%s\n", message);
|
||||||
|
@ -1542,11 +1543,11 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* embedded newlines -- argh! */
|
/* embedded newlines -- argh! */
|
||||||
while ((tmp = strchr(message, '\n')) != 0) {
|
while ((ctmp = strchr(message, '\n')) != 0) {
|
||||||
tmp++;
|
ctmp++;
|
||||||
if (prefix) fputs(prefix, gErrFile);
|
if (prefix) fputs(prefix, gErrFile);
|
||||||
fwrite(message, 1, tmp - message, gErrFile);
|
fwrite(message, 1, ctmp - message, gErrFile);
|
||||||
message = tmp;
|
message = ctmp;
|
||||||
}
|
}
|
||||||
/* If there were no filename or lineno, the prefix might be empty */
|
/* If there were no filename or lineno, the prefix might be empty */
|
||||||
if (prefix)
|
if (prefix)
|
||||||
|
|
|
@ -101,6 +101,7 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
|
||||||
{
|
{
|
||||||
int i, j, k, n;
|
int i, j, k, n;
|
||||||
char *prefix = NULL, *tmp;
|
char *prefix = NULL, *tmp;
|
||||||
|
const char *ctmp;
|
||||||
|
|
||||||
if (!report) {
|
if (!report) {
|
||||||
fprintf(gErrFile, "%s\n", message);
|
fprintf(gErrFile, "%s\n", message);
|
||||||
|
@ -121,11 +122,11 @@ my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* embedded newlines -- argh! */
|
/* embedded newlines -- argh! */
|
||||||
while ((tmp = strchr(message, '\n')) != 0) {
|
while ((ctmp = strchr(message, '\n')) != 0) {
|
||||||
tmp++;
|
ctmp++;
|
||||||
if (prefix) fputs(prefix, gErrFile);
|
if (prefix) fputs(prefix, gErrFile);
|
||||||
fwrite(message, 1, tmp - message, gErrFile);
|
fwrite(message, 1, ctmp - message, gErrFile);
|
||||||
message = tmp;
|
message = ctmp;
|
||||||
}
|
}
|
||||||
/* If there were no filename or lineno, the prefix might be empty */
|
/* If there were no filename or lineno, the prefix might be empty */
|
||||||
if (prefix)
|
if (prefix)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче