svn commit: r367199 - head/lib/libc/gen

Stefan Eßer se at FreeBSD.org
Sat Oct 31 12:10:44 UTC 2020


Author: se
Date: Sat Oct 31 12:10:43 2020
New Revision: 367199
URL: https://svnweb.freebsd.org/changeset/base/367199

Log:
  Fix reversed condition after attempted style fix in r367196
  
  Reported by:	xtouqh at hotmail.com
  MFC after:	3 days

Modified:
  head/lib/libc/gen/sysctl.c

Modified: head/lib/libc/gen/sysctl.c
==============================================================================
--- head/lib/libc/gen/sysctl.c	Sat Oct 31 12:05:00 2020	(r367198)
+++ head/lib/libc/gen/sysctl.c	Sat Oct 31 12:10:43 2020	(r367199)
@@ -79,7 +79,7 @@ sysctl(const int *name, u_int namelen, void *oldp, siz
 
 	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, siz
 			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);
 		}


More information about the svn-src-all mailing list