Skip to content
Snippets Groups Projects
Commit 1c05c4e4 authored by rswindell's avatar rswindell
Browse files

Likely bug-fix: word_wrap() can actually triple the number of bytes in a buffer.

parent 1b505dc8
No related branches found
No related tags found
No related merge requests found
......@@ -604,7 +604,7 @@ js_word_wrap(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if((inbuf=JS_GetStringBytes(JS_ValueToString(cx, argv[0])))==NULL)
return(JS_FALSE);
if((outbuf=(char*)malloc((strlen(inbuf)*2)+1))==NULL)
if((outbuf=(char*)malloc((strlen(inbuf)*3)+1))==NULL)
return(JS_FALSE);
if(argc>1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment