diff options
author | Gleydson Soares <gsoares@cvs.openbsd.org> | 2017-02-22 14:40:47 +0000 |
---|---|---|
committer | Gleydson Soares <gsoares@cvs.openbsd.org> | 2017-02-22 14:40:47 +0000 |
commit | ea2437fb9e4ee8afaac3326cdf2b9327c79e3dfd (patch) | |
tree | c80e390bb6c5474c9e3eb38209ccb1511a704e59 /usr.sbin/ldapd | |
parent | b2db41d412adaa85e6c49d906a3477af084bdb3a (diff) |
print a formatted errx() string instead of segfault,
by checking argc correctly.
ok guenther@
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r-- | usr.sbin/ldapd/btest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/btest.c b/usr.sbin/ldapd/btest.c index f0dfea93860..0eb6d72c40c 100644 --- a/usr.sbin/ldapd/btest.c +++ b/usr.sbin/ldapd/btest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btest.c,v 1.2 2015/12/24 17:47:57 mmcc Exp $ */ +/* $OpenBSD: btest.c,v 1.3 2017/02/22 14:40:46 gsoares Exp $ */ /* Simple test program for the btree database. */ /* @@ -74,7 +74,7 @@ main(int argc, char **argv) else printf("FAIL\n"); } else if (strcmp(argv[0], "del") == 0) { - if (argc < 1) + if (argc < 2) errx(1, "missing argument"); key.data = argv[1]; key.size = strlen(key.data); |