within the getparameter a lot, we must check it for NULL before accessing the
str data.
CID 14 of the coverity.com scan
* non-zero on failure, zero on success.
*
* 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)
{
int retcode = 0;
- if(ISDIGIT(*str))
+ if(str && ISDIGIT(*str))
*val = atoi(str);
else
retcode = 1; /* badness */