Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit bb44e9c0 authored by deuce's avatar deuce
Browse files

Don't postincrement in macro arguments.

parent 117ffb7b
......@@ -424,7 +424,8 @@ js_load(JSContext *cx, uintN argc, jsval *arglist)
}
return(JS_FALSE);
}
JSVALUE_TO_MSTRING(cx, argv[argn++], filename, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], filename, NULL);
argn++;
if(filename==NULL) { // This handles the pending error as well as a null JS string.
if(background) {
rc=JS_SUSPENDREQUEST(cx);
......@@ -3132,12 +3133,14 @@ js_fmutex(JSContext *cx, uintN argc, jsval *arglist)
if(argc==0 || JSVAL_IS_VOID(argv[0]))
return(JS_TRUE);
JSVALUE_TO_MSTRING(cx, argv[argn++], fname, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], fname, NULL);
argn++;
HANDLE_PENDING(cx);
if(fname==NULL)
return(JS_TRUE);
if(argc > argn && JSVAL_IS_STRING(argv[argn])) {
JSVALUE_TO_MSTRING(cx, argv[argn++], text, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], text, NULL);
argn++;
if(JS_IsExceptionPending(cx)) {
free(fname);
return JS_FALSE;
......@@ -3268,13 +3271,15 @@ js_wildmatch(JSContext *cx, uintN argc, jsval *arglist)
if(JSVAL_IS_BOOLEAN(argv[argn]))
JS_ValueToBoolean(cx, argv[argn++], &case_sensitive);
JSVALUE_TO_MSTRING(cx, argv[argn++], fname, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], fname, NULL);
argn++;
HANDLE_PENDING(cx);
if(fname==NULL)
return(JS_TRUE);
if(argn<argc && argv[argn]!=JSVAL_VOID) {
JSVALUE_TO_MSTRING(cx, argv[argn++], spec, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], spec, NULL);
argn++;
if(JS_IsExceptionPending(cx)) {
free(fname);
return JS_FALSE;
......
......@@ -268,7 +268,8 @@ js_write(JSContext *cx, uintN argc, jsval *arglist)
val = argv[argn++];
if(argn < argc) {
JSVALUE_TO_MSTRING(cx, argv[argn++], name, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], name, NULL);
argn++;
HANDLE_PENDING(cx);
}
......@@ -435,8 +436,10 @@ js_queue_constructor(JSContext *cx, uintN argc, jsval *arglist)
memset(q,0,sizeof(msg_queue_t));
#endif
if(argn<argc && JSVAL_IS_STRING(argv[argn]))
JSVALUE_TO_ASTRING(cx, argv[argn++], name, sizeof(q->name), NULL);
if(argn<argc && JSVAL_IS_STRING(argv[argn])) {
JSVALUE_TO_ASTRING(cx, argv[argn], name, sizeof(q->name), NULL);
argn++;
}
if(argn<argc && JSVAL_IS_NUMBER(argv[argn])) {
if(!JS_ValueToInt32(cx,argv[argn++],&flags))
......
......@@ -46,7 +46,8 @@ js_sprintf(JSContext *cx, uint argn, uintN argc, jsval *argv)
char *p2=NULL;
size_t p2_sz=0;
JSVALUE_TO_MSTRING(cx, argv[argn++], op, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], op, NULL);
argn++;
if(JS_IsExceptionPending(cx))
JS_ClearPendingException(cx);
if(op==NULL)
......
......@@ -822,6 +822,7 @@ js_matchuser(JSContext *cx, uintN argc, jsval *arglist)
JS_ValueToBoolean(cx,argv[1],&sysop_alias);
JSSTRING_TO_ASTRING(cx, js_str, p, (LEN_ALIAS > LEN_NAME) ? LEN_ALIAS+2:LEN_NAME+2, NULL);
fprintf(stderr,"p=%p (%s)\n",p,p?p:"(null)");
if(p==NULL) {
JS_SET_RVAL(cx, arglist, INT_TO_JSVAL(0));
return(JS_TRUE);
......
......@@ -422,13 +422,15 @@ js_uifc_input(JSContext *cx, uintN argc, jsval *arglist)
&& !JS_ValueToInt32(cx,argv[argn++],&top))
return(JS_FALSE);
if(argn<argc && JSVAL_IS_STRING(argv[argn])) {
JSVALUE_TO_MSTRING(cx, argv[argn++], prompt, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], prompt, NULL);
argn++;
HANDLE_PENDING(cx);
if(prompt==NULL)
return(JS_TRUE);
}
if(argn<argc && JSVAL_IS_STRING(argv[argn])) {
JSVALUE_TO_MSTRING(cx, argv[argn++], org, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], org, NULL);
argn++;
if(JS_IsExceptionPending(cx)) {
if(prompt)
free(prompt);
......@@ -539,7 +541,8 @@ js_uifc_list(JSContext *cx, uintN argc, jsval *arglist)
&& !JS_ValueToInt32(cx,argv[argn++],&bar))
return(JS_FALSE);
if(argn<argc && JSVAL_IS_STRING(argv[argn])) {
JSVALUE_TO_MSTRING(cx, argv[argn++], title, NULL);
JSVALUE_TO_MSTRING(cx, argv[argn], title, NULL);
argn++;
HANDLE_PENDING(cx);
}
if(argn<argc && JSVAL_IS_OBJECT(argv[argn])) {
......
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