summaryrefslogtreecommitdiffstats
path: root/usr.bin/getconf/getconf.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-04 08:45:38 +0000
committertjr <tjr@FreeBSD.org>2002-06-04 08:45:38 +0000
commit92fc7ca036bab74b3682ead86f68ccc50a9b74bc (patch)
treef5c5a8cdcc6efd7a377edafa0ec60c52d0c71e57 /usr.bin/getconf/getconf.c
parenta6a057aabb423d77fe9736daf7a9a7905119768c (diff)
downloadFreeBSD-src-92fc7ca036bab74b3682ead86f68ccc50a9b74bc.zip
FreeBSD-src-92fc7ca036bab74b3682ead86f68ccc50a9b74bc.tar.gz
confstr() returns (size_t)-1 on failure. Check for this explicitly instead
of trying to see if an unsigned number is less than zero.
Diffstat (limited to 'usr.bin/getconf/getconf.c')
-rw-r--r--usr.bin/getconf/getconf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c
index 87b91b1..721eaa7 100644
--- a/usr.bin/getconf/getconf.c
+++ b/usr.bin/getconf/getconf.c
@@ -112,7 +112,7 @@ do_confstr(const char *name, int key)
size_t len;
len = confstr(key, 0, 0);
- if (len < 0)
+ if (len == (size_t)-1)
err(EX_OSERR, "confstr: %s", name);
if (len == 0) {
OpenPOWER on IntegriCloud