libjs: fix build warning under gcc 4.3

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11521 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-01-27 23:15:42 +00:00
parent fd0a6589e0
commit ec864cee4c
1 changed files with 6 additions and 4 deletions

View File

@ -4076,12 +4076,13 @@ JS_EvaluateScript(JSContext *cx, JSObject *obj,
{ {
jschar *chars; jschar *chars;
JSBool ok; JSBool ok;
size_t slength = length;
CHECK_REQUEST(cx); CHECK_REQUEST(cx);
chars = js_InflateString(cx, bytes, &length); chars = js_InflateString(cx, bytes, &slength);
if (!chars) if (!chars)
return JS_FALSE; return JS_FALSE;
ok = JS_EvaluateUCScript(cx, obj, chars, length, filename, lineno, rval); ok = JS_EvaluateUCScript(cx, obj, chars, slength, filename, lineno, rval);
JS_free(cx, chars); JS_free(cx, chars);
return ok; return ok;
} }
@ -4095,12 +4096,13 @@ JS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,
{ {
jschar *chars; jschar *chars;
JSBool ok; JSBool ok;
size_t slength = length;
CHECK_REQUEST(cx); CHECK_REQUEST(cx);
chars = js_InflateString(cx, bytes, &length); chars = js_InflateString(cx, bytes, &slength);
if (!chars) if (!chars)
return JS_FALSE; return JS_FALSE;
ok = JS_EvaluateUCScriptForPrincipals(cx, obj, principals, chars, length, ok = JS_EvaluateUCScriptForPrincipals(cx, obj, principals, chars, slength,
filename, lineno, rval); filename, lineno, rval);
JS_free(cx, chars); JS_free(cx, chars);
return ok; return ok;