From f67037863f831db4eeec28cc9dbe4c9b6074cb32 Mon Sep 17 00:00:00 2001 From: se 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 3b7de5c0ea3..ac614001303 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); } -- 2.45.0