From 91b14bffacc9c59a0e0684875a9cee1f91194403 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Tue, 4 Jun 2002 08:45:38 +0000 Subject: [PATCH] confstr() returns (size_t)-1 on failure. Check for this explicitly instead of trying to see if an unsigned number is less than zero. --- usr.bin/getconf/getconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index 87b91b1a283..721eaa77d26 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) { -- 2.45.2