mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-10 20:35:22 +00:00
Use ToJSVal for JS_NewStringCopyZ to improve encapsulation and consistency and remove a snprintf call.
This was SVN commit r22536.
This commit is contained in:
@@ -591,10 +591,7 @@ bool JSI_IGUIObject::toString(JSContext* cx, uint UNUSED(argc), JS::Value* vp)
|
||||
if (!e)
|
||||
return false;
|
||||
|
||||
char buffer[256];
|
||||
snprintf(buffer, 256, "[GUIObject: %s]", e->GetName().c_str());
|
||||
buffer[255] = 0;
|
||||
rec.rval().setString(JS_NewStringCopyZ(cx, buffer));
|
||||
ScriptInterface::ToJSVal(cx, rec.rval(), "[GUIObject: " + e->GetName() + "]");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user