From 3b9795a2e83352d61ca9a1b8746e2ee412d5d93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Sat, 31 Oct 2020 12:10:43 +0000 Subject: [PATCH] Fix reversed condition after attempted style fix in r367196 Reported by: xtouqh@hotmail.com MFC after: 3 days --- lib/libc/gen/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c index 3b7de5c0ea31..ac6140013038 100644 --- a/lib/libc/gen/sysctl.c +++ b/lib/libc/gen/sysctl.c @@ -79,7 +79,7 @@ sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, switch (name[1]) { case USER_CS_PATH: - if (oldp == NULL && orig_oldlen < sizeof(_PATH_STDPATH)) { + if (oldp != NULL && orig_oldlen < sizeof(_PATH_STDPATH)) { errno = ENOMEM; return (-1); } @@ -88,7 +88,7 @@ sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); case USER_LOCALBASE: - if (oldp == NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { + if (oldp != NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { errno = ENOMEM; return (-1); }