summaryrefslogtreecommitdiffstats
path: root/usr.sbin/kvm_mkdb/kvm_mkdb.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-01-15 22:08:15 +0000
committermillert <millert@openbsd.org>1997-01-15 22:08:15 +0000
commit2d68270107519326aff21b626d8fa87acd5600a7 (patch)
tree12d3f50fbf34df143e99a39a89b0deed79c86104 /usr.sbin/kvm_mkdb/kvm_mkdb.c
parentWell, actually this seemed to be a bug in generic code, that (diff)
downloadwireguard-openbsd-2d68270107519326aff21b626d8fa87acd5600a7.tar.xz
wireguard-openbsd-2d68270107519326aff21b626d8fa87acd5600a7.zip
From NetBSD: make testdb() fail if database version string has length zero.
Also, KNF, b* -> mem*, getopt tests against -1, not EOF, and index -> strchr. Added OpenBSD tags.
Diffstat (limited to 'usr.sbin/kvm_mkdb/kvm_mkdb.c')
-rw-r--r--usr.sbin/kvm_mkdb/kvm_mkdb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c
index 9a2c7589cd9..85012947ce4 100644
--- a/usr.sbin/kvm_mkdb/kvm_mkdb.c
+++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: kvm_mkdb.c,v 1.2 1997/01/15 22:08:15 millert Exp $ */
+
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -38,8 +40,11 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)kvm_mkdb.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: kvm_mkdb.c,v 1.1.1.1 1995/10/18 08:47:39 deraadt Exp $";
+#if 0
+static char sccsid[] = "from: @(#)kvm_mkdb.c 8.1 (Berkeley) 6/6/93";
+#else
+static char *rcsid = "$OpenBSD: kvm_mkdb.c,v 1.2 1997/01/15 22:08:15 millert Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
@@ -76,7 +81,7 @@ main(argc, argv)
int ch;
char *p, *nlistpath, *nlistname, dbtemp[MAXPATHLEN], dbname[MAXPATHLEN];
- while ((ch = getopt(argc, argv, "")) != EOF)
+ while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
case '?':
default:
@@ -92,7 +97,7 @@ main(argc, argv)
if (testdb())
exit(0);
-#define basename(cp) ((p = rindex((cp), '/')) != NULL ? p + 1 : (cp))
+#define basename(cp) ((p = strrchr((cp), '/')) != NULL ? p + 1 : (cp))
nlistpath = argc > 0 ? argv[0] : _PATH_UNIX;
nlistname = basename(nlistpath);