Loading src/main.c +5 −1 Original line number Original line Diff line number Diff line Loading @@ -1273,12 +1273,16 @@ static void cleanarg(char *str) * non-zero on failure, zero on success. * non-zero on failure, zero on success. * * * The string must start with a digit to be valid. * The string must start with a digit to be valid. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ */ static int str2num(long *val, char *str) static int str2num(long *val, char *str) { { int retcode = 0; int retcode = 0; if(ISDIGIT(*str)) if(str && ISDIGIT(*str)) *val = atoi(str); *val = atoi(str); else else retcode = 1; /* badness */ retcode = 1; /* badness */ Loading Loading
src/main.c +5 −1 Original line number Original line Diff line number Diff line Loading @@ -1273,12 +1273,16 @@ static void cleanarg(char *str) * non-zero on failure, zero on success. * non-zero on failure, zero on success. * * * The string must start with a digit to be valid. * The string must start with a digit to be valid. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ */ static int str2num(long *val, char *str) static int str2num(long *val, char *str) { { int retcode = 0; int retcode = 0; if(ISDIGIT(*str)) if(str && ISDIGIT(*str)) *val = atoi(str); *val = atoi(str); else else retcode = 1; /* badness */ retcode = 1; /* badness */ Loading