Give numeric options the value 0 if a non-numeric text is entered. Before the value...
authorByrial Jensen <byrial@vip.cybercity.dk>
Sun, 18 Dec 2011 16:08:46 +0000 (17:08 +0100)
committerByrial Jensen <byrial@vip.cybercity.dk>
Sun, 18 Dec 2011 16:08:46 +0000 (17:08 +0100)
xoptions.c

index c1ae427..ecfe022 100644 (file)
@@ -155,7 +155,7 @@ void SpinCallback(w, client_data, call_data)
     String name, val;
     Arg args[16];
     char buf[MSG_SIZ], *p;
     String name, val;
     Arg args[16];
     char buf[MSG_SIZ], *p;
-    int j;
+    int j = 0; // Initialiasation is necessary because the text value may be non-numeric causing the scanf conversion to fail
     int data = (intptr_t) client_data;
 
     XtSetArg(args[0], XtNlabel, &name);
     int data = (intptr_t) client_data;
 
     XtSetArg(args[0], XtNlabel, &name);