summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/net/getaddrinfo.c6
-rw-r--r--lib/libc/net/gethostbyht.c6
-rw-r--r--lib/libc/net/getnetbyht.c5
-rw-r--r--lib/libc/net/getprotoent.c5
-rw-r--r--lib/libc/net/getservent.c5
5 files changed, 12 insertions, 15 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 6508024d6cb0..9c4948e7fc7f 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -2070,9 +2070,9 @@ again:
return (NULL);
if (*p == '#')
goto again;
- if (!(cp = strpbrk(p, "#\n")))
- goto again;
- *cp = '\0';
+ cp = strpbrk(p, "#\n");
+ if (cp != NULL)
+ *cp = '\0';
if (!(cp = strpbrk(p, " \t")))
goto again;
*cp++ = '\0';
diff --git a/lib/libc/net/gethostbyht.c b/lib/libc/net/gethostbyht.c
index e4320fd8a2cc..e414058e0e42 100644
--- a/lib/libc/net/gethostbyht.c
+++ b/lib/libc/net/gethostbyht.c
@@ -118,9 +118,9 @@ gethostent()
}
if (*p == '#')
goto again;
- if (!(cp = strpbrk(p, "#\n")))
- goto again;
- *cp = '\0';
+ cp = strpbrk(p, "#\n");
+ if (cp != NULL)
+ *cp = '\0';
if (!(cp = strpbrk(p, " \t")))
goto again;
*cp++ = '\0';
diff --git a/lib/libc/net/getnetbyht.c b/lib/libc/net/getnetbyht.c
index 6eaebc52a0a6..f5364220a5e5 100644
--- a/lib/libc/net/getnetbyht.c
+++ b/lib/libc/net/getnetbyht.c
@@ -105,9 +105,8 @@ again:
if (*p == '#')
goto again;
cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
+ if (cp != NULL)
+ *cp = '\0';
net.n_name = p;
cp = strpbrk(p, " \t");
if (cp == NULL)
diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c
index c8f1ad483e82..e2d7a975e362 100644
--- a/lib/libc/net/getprotoent.c
+++ b/lib/libc/net/getprotoent.c
@@ -87,9 +87,8 @@ again:
if (*p == '#')
goto again;
cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
+ if (cp != NULL)
+ *cp = '\0';
proto.p_name = p;
cp = strpbrk(p, " \t");
if (cp == NULL)
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index a89bc5173966..7e4423534339 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -244,9 +244,8 @@ unpack:
if (*p == '#')
goto again;
cp = strpbrk(p, "#\n");
- if (cp == NULL)
- goto again;
- *cp = '\0';
+ if (cp != NULL)
+ *cp = '\0';
serv.s_name = p;
p = strpbrk(p, " \t");
if (p == NULL)