Bug 607292 - followup to address comments 16 and 20 from the bug

This commit is contained in:
Igor Bukanov 2010-11-15 23:11:07 +01:00
parent a9ae1a03f4
commit 238c877cc8
3 changed files with 5 additions and 2 deletions

View File

@ -296,7 +296,6 @@ JS_ConvertArgumentsVA(JSContext *cx, uintN argc, jsval *argv, const char *format
return JS_FALSE;
*va_arg(ap, jsdouble *) = js_DoubleToInteger(d);
break;
case 's':
case 'S':
case 'W':
str = js_ValueToString(cx, Valueify(*sp));

View File

@ -556,7 +556,6 @@ JS_GetEmptyStringValue(JSContext *cx);
* j int32 Rounded int32 (coordinate)
* d jsdouble IEEE double
* I jsdouble Integral IEEE double
* s char * C string
* S JSString * Unicode string, accessed by a JSString pointer
* W jschar * Unicode character vector, 0-terminated (W for wide)
* o JSObject * Object reference

View File

@ -1000,7 +1000,12 @@ XPCConvert::JSData2Native(XPCCallContext& ccx, void* d, jsval s,
{
rs = *((nsACString**)d);
}
rs->SetLength(PRUint32(length));
if(rs->Length() != PRUint32(length))
{
return JS_FALSE;
}
JS_EncodeStringToBuffer(str, rs->BeginWriting(), length);
return JS_TRUE;