Commit d5ccd1e1 authored by deuce's avatar deuce
Browse files

Fix resolve functions in CPP

parent ddb2af61
......@@ -281,7 +281,7 @@ bool sbbs_t::checkfname(char *fname)
if(fname[0]=='-'
|| strcspn(fname,ILLEGAL_FILENAME_CHARS)!=strlen(fname)) {
lprintf(LOG_WARNING,"Suspicious filename attempt: '%s'",fname);
hacklog("Filename", fname);
hacklog((char *)"Filename", fname);
return(false);
}
if(strstr(fname,".."))
......
......@@ -3481,15 +3481,19 @@ static JSBool js_bbs_resolve(JSContext *cx, JSObject *obj, jsid id)
{
char* name=NULL;
if(id != JSVAL_NULL)
name=JS_GetStringBytes(JSVAL_TO_STRING(id));
if(id != JSID_VOID && id != JSID_EMPTY) {
jsval idval;
JS_IdToValue(cx, id, &idval);
name=JS_GetStringBytes(JSVAL_TO_STRING(idval));
}
return(js_SyncResolve(cx, obj, name, js_bbs_properties, js_bbs_functions, NULL, 0));
}
static JSBool js_bbs_enumerate(JSContext *cx, JSObject *obj)
{
return(js_bbs_resolve(cx, obj, JSVAL_NULL));
return(js_bbs_resolve(cx, obj, JSID_VOID));
}
static JSClass js_bbs_class = {
......
......@@ -1762,15 +1762,19 @@ static JSBool js_console_resolve(JSContext *cx, JSObject *obj, jsid id)
{
char* name=NULL;
if(id != JSVAL_NULL)
name=JS_GetStringBytes(JSVAL_TO_STRING(id));
if(id != JSID_VOID && id != JSID_EMPTY) {
jsval idval;
JS_IdToValue(cx, id, &idval);
name=JS_GetStringBytes(JSVAL_TO_STRING(idval));
}
return(js_SyncResolve(cx, obj, name, js_console_properties, js_console_functions, NULL, 0));
}
static JSBool js_console_enumerate(JSContext *cx, JSObject *obj)
{
return(js_console_resolve(cx, obj, JSVAL_NULL));
return(js_console_resolve(cx, obj, JSID_VOID));
}
static JSClass js_console_class = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment