Module Name:    src
Committed By:   mlelstv
Date:           Mon Aug 30 08:21:12 UTC 2021

Modified Files:
        src/usr.sbin/inetd: inetd.c

Log Message:
Fix reverted logic when parsing server program.
Compare pointer with NULL not 0.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/usr.sbin/inetd/inetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.128 src/usr.sbin/inetd/inetd.c:1.129
--- src/usr.sbin/inetd/inetd.c:1.128	Sun Aug 29 11:43:25 2021
+++ src/usr.sbin/inetd/inetd.c	Mon Aug 30 08:21:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.128 2021/08/29 11:43:25 christos Exp $	*/
+/*	$NetBSD: inetd.c,v 1.129 2021/08/30 08:21:12 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.128 2021/08/29 11:43:25 christos Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.129 2021/08/30 08:21:12 mlelstv Exp $");
 #endif
 #endif /* not lint */
 
@@ -2388,7 +2388,7 @@ parse_wait(struct servtab *sep, int wait
 int
 parse_server(struct servtab *sep, const char *arg){
 	sep->se_server = newstr(arg);
-	if (strcmp(sep->se_server, "internal") == 0) {
+	if (strcmp(sep->se_server, "internal") != 0) {
 		sep->se_bi = NULL;
 		return 0;
 	}
@@ -2398,7 +2398,7 @@ parse_server(struct servtab *sep, const 
 		if (bi->bi_socktype == sep->se_socktype &&
 		    strcmp(bi->bi_service, sep->se_service) == 0)
 			break;
-	if (bi->bi_service == 0) {
+	if (bi->bi_service == NULL) {
 		ERR("Internal service %s unknown",
 		    sep->se_service);
 		return -1;

Reply via email to