diff options
author | csgr <csgr@FreeBSD.org> | 1994-09-11 21:30:09 +0000 |
---|---|---|
committer | csgr <csgr@FreeBSD.org> | 1994-09-11 21:30:09 +0000 |
commit | a837391e8789f3b310e5447510f7b763087098a0 (patch) | |
tree | be06331550ca20fa4bea8f4c31136cc0d7c2a49b /bin/test | |
parent | 99504c52a37c2f78d487a799ef05f2b82931ce48 (diff) | |
download | FreeBSD-src-a837391e8789f3b310e5447510f7b763087098a0.zip FreeBSD-src-a837391e8789f3b310e5447510f7b763087098a0.tar.gz |
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
Diffstat (limited to 'bin/test')
-rw-r--r-- | bin/test/test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/test/test.c b/bin/test/test.c index 832257e..bde66b9 100644 --- a/bin/test/test.c +++ b/bin/test/test.c @@ -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); |