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:
jband%netscape.com 1999-10-18 23:45:39 +00:00
Родитель 8cf6cf4767
Коммит 63c50e078a
2 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -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)