summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjf <mjf@NetBSD.org>2006-12-06 11:05:32 +0000
committermjf <mjf@NetBSD.org>2006-12-06 11:05:32 +0000
commitc74271d8eae5468f736df31c7708eba6da8112e7 (patch)
tree7a8481c9c4f3fb240523e9506611a680c9fa7c7c
parentecf62325882a2880a7e00092b7cfc5b2b4914186 (diff)
PR/35194: confstr(3) returns 0 on failure, not -1.
-rw-r--r--usr.bin/getconf/getconf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c
index 9261e0a6daa..449251d5990 100644
--- a/usr.bin/getconf/getconf.c
+++ b/usr.bin/getconf/getconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getconf.c,v 1.24 2006/11/10 15:36:04 christos Exp $ */
+/* $NetBSD: getconf.c,v 1.25 2006/12/06 11:05:32 mjf Exp $ */
/*-
* Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: getconf.c,v 1.24 2006/11/10 15:36:04 christos Exp $");
+__RCSID("$NetBSD: getconf.c,v 1.25 2006/12/06 11:05:32 mjf Exp $");
#endif /* not lint */
#include <err.h>
@@ -266,13 +266,13 @@ printvar(const struct conf_variable *cp, const char *pathname)
case CONFSTR:
slen = confstr((int)cp->value, NULL, 0);
- if (slen == (size_t)-1)
+ if (slen == 0)
out: err(EXIT_FAILURE, "confstr(%ld)", cp->value);
if ((sval = malloc(slen)) == NULL)
err(EXIT_FAILURE, "Can't allocate %zu bytes", slen);
- if (confstr((int)cp->value, sval, slen) == (size_t)-1)
+ if (confstr((int)cp->value, sval, slen) == 0)
goto out;
print_strvar(cp->name, sval);
free(sval);