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

freediskspace property is return as double if sign bit is set (so free space

>= 4GB is read as 4GB and not -1).
parent ba3b5fe1
No related branches found
No related tags found
No related merge requests found
...@@ -99,6 +99,7 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp) ...@@ -99,6 +99,7 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{ {
char str[128]; char str[128];
jsint tiny; jsint tiny;
ulong val;
scfg_t* cfg; scfg_t* cfg;
if((cfg=(scfg_t*)JS_GetPrivate(cx,obj))==NULL) if((cfg=(scfg_t*)JS_GetPrivate(cx,obj))==NULL)
...@@ -151,7 +152,11 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp) ...@@ -151,7 +152,11 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, lastuseron)); *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, lastuseron));
break; break;
case SYS_PROP_FREEDISKSPACE: case SYS_PROP_FREEDISKSPACE:
*vp = INT_TO_JSVAL(getfreediskspace(cfg->temp_dir)); val = getfreediskspace(cfg->temp_dir);
if(INT_FITS_IN_JSVAL(val) && !(val&0x80000000))
*vp = INT_TO_JSVAL(val);
else
JS_NewDoubleValue(cx, val, vp);
break; break;
case SYS_PROP_NEW_PASS: case SYS_PROP_NEW_PASS:
......
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