summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldapctl/ldapctl.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-27 18:03:36 +0000
committerderaadt <deraadt@openbsd.org>2019-06-27 18:03:36 +0000
commit95af8abf27078f6d0f9a407e501f247e19a4d49c (patch)
tree402427689b0f08e28b0b8d8e77348e34a28da69c /usr.sbin/ldapctl/ldapctl.c
parentEnable MSI-X interrupts. (diff)
downloadwireguard-openbsd-95af8abf27078f6d0f9a407e501f247e19a4d49c.tar.xz
wireguard-openbsd-95af8abf27078f6d0f9a407e501f247e19a4d49c.zip
Some asprintf() calls were checked < 0, rather than the precise == -1.
ok millert nicm tb, etc
Diffstat (limited to 'usr.sbin/ldapctl/ldapctl.c')
-rw-r--r--usr.sbin/ldapctl/ldapctl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ldapctl/ldapctl.c b/usr.sbin/ldapctl/ldapctl.c
index 35006cddebc..d9f6a464940 100644
--- a/usr.sbin/ldapctl/ldapctl.c
+++ b/usr.sbin/ldapctl/ldapctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapctl.c,v 1.11 2018/05/15 11:19:21 reyk Exp $ */
+/* $OpenBSD: ldapctl.c,v 1.12 2019/06/27 18:03:37 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -101,7 +101,7 @@ compact_namespace(struct namespace *ns, const char *datadir)
{
char *path;
- if (asprintf(&path, "%s/%s_data.db", datadir, ns->suffix) < 0)
+ if (asprintf(&path, "%s/%s_data.db", datadir, ns->suffix) == -1)
return -1;
if (compact_db(path) != 0) {
log_warn("%s", path);
@@ -110,7 +110,7 @@ compact_namespace(struct namespace *ns, const char *datadir)
}
free(path);
- if (asprintf(&path, "%s/%s_indx.db", datadir, ns->suffix) < 0)
+ if (asprintf(&path, "%s/%s_indx.db", datadir, ns->suffix) == -1)
return -1;
if (compact_db(path) != 0) {
log_warn("%s", path);
@@ -150,14 +150,14 @@ index_namespace(struct namespace *ns, const char *datadir)
log_info("indexing namespace %s", ns->suffix);
- if (asprintf(&path, "%s/%s_data.db", DATADIR, ns->suffix) < 0)
+ if (asprintf(&path, "%s/%s_data.db", DATADIR, ns->suffix) == -1)
return -1;
data_db = btree_open(path, BT_NOSYNC | BT_REVERSEKEY, 0644);
free(path);
if (data_db == NULL)
return -1;
- if (asprintf(&path, "%s/%s_indx.db", datadir, ns->suffix) < 0)
+ if (asprintf(&path, "%s/%s_indx.db", datadir, ns->suffix) == -1)
return -1;
indx_db = btree_open(path, BT_NOSYNC, 0644);
free(path);