Skip to content
Snippets Groups Projects
Commit 03e5f5cc authored by deuce's avatar deuce
Browse files

No, the well-named strlen variable does not include the NULL terminator

Mr. Smarty Pants.
parent 1bf13e1f
No related branches found
No related tags found
No related merge requests found
...@@ -2468,7 +2468,7 @@ js_internal_charfunc(JSContext *cx, uintN argc, jsval *arglist, char *(*func)(ch ...@@ -2468,7 +2468,7 @@ js_internal_charfunc(JSContext *cx, uintN argc, jsval *arglist, char *(*func)(ch
if(str==NULL) if(str==NULL)
return(JS_TRUE); return(JS_TRUE);
if(extra_bytes) { if(extra_bytes) {
rastr=realloc(str, strlen+extra_bytes); rastr=realloc(str, strlen+extra_bytes+1 /* for terminator */);
if(rastr==NULL) if(rastr==NULL)
return JS_TRUE; return JS_TRUE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment