aboutsummaryrefslogtreecommitdiff
path: root/bin/test/test.c
diff options
context:
space:
mode:
authorGeoff Rehmet <csgr@FreeBSD.org>1994-09-11 21:30:09 +0000
committerGeoff Rehmet <csgr@FreeBSD.org>1994-09-11 21:30:09 +0000
commit282d7272803489b87965bfd48d683b4218014936 (patch)
treebe06331550ca20fa4bea8f4c31136cc0d7c2a49b /bin/test/test.c
parentfcccde58934f4820887722fdd5c67040a5b87647 (diff)
downloadsrc-282d7272803489b87965bfd48d683b4218014936.tar.gz
src-282d7272803489b87965bfd48d683b4218014936.zip
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
Notes
Notes: svn path=/head/; revision=2675
Diffstat (limited to 'bin/test/test.c')
-rw-r--r--bin/test/test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/test/test.c b/bin/test/test.c
index 832257e29323..bde66b9fabac 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);