Closed
Bug 12768
Opened 26 years ago
Closed 26 years ago
Should be const char when pointing to a const char
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
RESOLVED
FIXED
People
(Reporter: Dan.Oscarsson, Assigned: jband_mozilla)
Details
strchr on a const char need to be assigned to const char
message is of type const char so you need to assign the result
of a strchr to a const char. Otherwise a Sun compiler will make an error.
*** mozilla/js/src/xpconnect/shell/xpcshell.cpp.org Sat Aug 28 13:48:29 1999
--- mozilla/js/src/xpconnect/shell/xpcshell.cpp Sun Aug 29 16:38:07 1999
***************
*** 82,87 ****
--- 82,88 ----
{
int i, j, k, n;
char *prefix = NULL, *tmp;
+ const char *ctmp;
if (!report) {
fprintf(gErrFile, "%s\n", message);
***************
*** 102,112 ****
}
/* embedded newlines -- argh! */
! while ((tmp = strchr(message, '\n')) != 0) {
! tmp++;
if (prefix) fputs(prefix, gErrFile);
! fwrite(message, 1, tmp - message, gErrFile);
! message = tmp;
}
/* If there were no filename or lineno, the prefix might be empty */
if (prefix)
--- 103,113 ----
}
/* embedded newlines -- argh! */
! while ((ctmp = strchr(message, '\n')) != 0) {
! ctmp++;
if (prefix) fputs(prefix, gErrFile);
! fwrite(message, 1, ctmp - message, gErrFile);
! message = ctmp;
}
/* If there were no filename or lineno, the prefix might be empty */
if (prefix)
Updated•26 years ago
|
Assignee: mccabe → jband
Comment 1•26 years ago
|
||
xpcshell is John Bandhauer's. Sorry for sitting on this...
| Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•26 years ago
|
||
This is code copied from js.c. If it needs to be fixed here then it needs to be
fixed there too.
| Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 3•26 years ago
|
||
I checked in this fix for both xpcshell.cpp and js.c
Thanks!
You need to log in
before you can comment on or make changes to this bug.
Description
•