mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
Fix bug: space was not allocated for terminal '\0' in string.
Spell "JavaScript" correctly.
This commit is contained in:
parent
899616933a
commit
c6b299a84d
@ -196,10 +196,10 @@ Process(JSContext *cx, JSObject *obj, char *filename)
|
||||
|
||||
/* XXX non-i18nized strings... */
|
||||
if (str) {
|
||||
fprintf(stderr, "Uncaught javascript exception:\n%s\n",
|
||||
fprintf(stderr, "Uncaught JavaScript exception:\n%s\n",
|
||||
JS_GetStringBytes(str));
|
||||
} else {
|
||||
fprintf(stderr, "Uncaught javascript exception\n");
|
||||
fprintf(stderr, "Uncaught JavaScript exception\n");
|
||||
}
|
||||
}
|
||||
JS_DestroyScript(cx, script);
|
||||
|
@ -72,7 +72,7 @@ exn_initPrivate(JSContext *cx, JSErrorReport *report, const char *message)
|
||||
newPrivate = (JSExnPrivate *)JS_malloc(cx, sizeof (JSExnPrivate));
|
||||
|
||||
PR_ASSERT(message);
|
||||
newMessage = (char *)JS_malloc(cx, strlen(message));
|
||||
newMessage = (char *)JS_malloc(cx, strlen(message)+1);
|
||||
strcpy(newMessage, message);
|
||||
newPrivate->message = newMessage;
|
||||
|
||||
@ -81,7 +81,7 @@ exn_initPrivate(JSContext *cx, JSErrorReport *report, const char *message)
|
||||
|
||||
if (report->filename) {
|
||||
newReport->filename =
|
||||
(const char *)JS_malloc(cx, strlen(report->filename));
|
||||
(const char *)JS_malloc(cx, strlen(report->filename)+1);
|
||||
/* Ack. Const! */
|
||||
strcpy((char *)newReport->filename, report->filename);
|
||||
} else {
|
||||
@ -110,7 +110,7 @@ exn_initPrivate(JSContext *cx, JSErrorReport *report, const char *message)
|
||||
|
||||
#if 0
|
||||
if (report->uclinebuf) {
|
||||
size_t len = js_strlen(report->uclinebuf);
|
||||
size_t len = js_strlen(report->uclinebuf)+1;
|
||||
newReport->uclinebuf =
|
||||
(const jschar *)JS_malloc(cx, len);
|
||||
js_strncpy(newReport->uclinebuf, report->uclinebuf, len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user