Make get_int() think that "" (null) has the integer value 0.

(Which is the same behaviour as in 1.x)
The install blows up without this.
Reviewed by:	rgrimes
This commit is contained in:
csgr 1994-09-11 21:30:09 +00:00
parent 99504c52a3
commit a837391e87

View File

@ -529,6 +529,11 @@ get_int(v, lp)
for (; *v && isspace(*v); ++v);
if(!*v) {
*lp = 0;
return;
}
if (isdigit(*v) || ((*v == '-' || *v == '+') && isdigit(*(v+1)))) {
errno = 0;
val = strtol(v, &ep, 10);