From 742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb Mon Sep 17 00:00:00 2001 From: sobomax Date: Mon, 3 Jan 2005 11:07:45 +0000 Subject: Don't ignore the last line of config file (/etc/hosts, /etc/services, etc) which doesn't end in \n, since it may be very confusing. Also this should increase consistency, since most other config files work just fine regardless of the presence of traling \n in the last line. MFC After: 2 weeks --- lib/libc/net/getprotoent.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libc/net/getprotoent.c') diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c index c8f1ad4..e2d7a97 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) -- cgit v1.1