Check in patch for bug 94580, thanks to Bernard Alleysson <balleysson@bigfoot.com> for researching and writing it (r=me, sr=shaver).

This commit is contained in:
brendan%mozilla.org 2001-09-29 21:30:26 +00:00
parent b22c4d0d63
commit 8cf1697439

View File

@ -1433,10 +1433,14 @@ JS_free(JSContext *cx, void *p)
JS_PUBLIC_API(char *)
JS_strdup(JSContext *cx, const char *s)
{
char *p = (char *) JS_malloc(cx, strlen(s) + 1);
size_t n;
void *p;
n = strlen(s) + 1;
p = JS_malloc(cx, n);
if (!p)
return NULL;
return strcpy(p, s);
return (char *)memcpy(p, s, n);
}
JS_PUBLIC_API(jsdouble *)