Browse Source

remove incorrect and useless check in network service name lookup code

the condition was probably intended to be !*p rather than !p, but
neither is needed here. the subsequent code naturally handles the case
where it's already at end of string.
Rich Felker 10 năm trước cách đây
mục cha
commit
4ec2d25a6a
1 tập tin đã thay đổi với 0 bổ sung1 xóa
  1. 0 1
      src/network/lookup_serv.c

+ 0 - 1
src/network/lookup_serv.c

@@ -52,7 +52,6 @@ int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int pro
 
 		/* Skip past canonical name at beginning of line */
 		for (p=line; *p && !isspace(*p); p++);
-		if (!p) continue;
 
 		port = strtoul(p, &z, 10);
 		if (port > 65535 || z==p) continue;