summaryrefslogtreecommitdiff
path: root/lib/libc/time
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-29 16:12:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-29 16:12:22 +0000
commita375712a16ebb76f903dc8c52ea74fcc72e2ee45 (patch)
treeb7892b3a0c6d2fddccd24cf5bc70e52caaf580cf /lib/libc/time
parenteffc883426ee0f8f208d48af074802bff6cad8b7 (diff)
two more syscall == -1 checks
Diffstat (limited to 'lib/libc/time')
-rw-r--r--lib/libc/time/strftime.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/time/strftime.c b/lib/libc/time/strftime.c
index d618d2aa4e3..9536d189bf3 100644
--- a/lib/libc/time/strftime.c
+++ b/lib/libc/time/strftime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strftime.c,v 1.31 2019/05/12 12:49:52 schwarze Exp $ */
+/* $OpenBSD: strftime.c,v 1.32 2019/06/29 16:12:21 deraadt Exp $ */
/*
** Copyright (c) 1989, 1993
** The Regents of the University of California. All rights reserved.
@@ -614,7 +614,7 @@ _loc(void)
if (len < 0 || len >= sizeof filename)
goto no_locale;
fd = open(filename, O_RDONLY);
- if (fd < 0) {
+ if (fd == -1) {
/*
** Old Sun systems have a different naming and data convention.
*/
@@ -624,10 +624,10 @@ _loc(void)
if (len < 0 || len >= sizeof filename)
goto no_locale;
fd = open(filename, O_RDONLY);
- if (fd < 0)
+ if (fd == -1)
goto no_locale;
}
- if (fstat(fd, &st) != 0)
+ if (fstat(fd, &st) == -1)
goto bad_locale;
if (st.st_size <= 0)
goto bad_locale;