diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-01-03 11:07:45 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-01-03 11:07:45 +0000 |
commit | 742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb (patch) | |
tree | 932dc5516fad9adc5c8df459d8e23846159bce61 /lib/libc/net/getaddrinfo.c | |
parent | 4bf9384dba041617b5b6f2757dd817023110f50f (diff) | |
download | FreeBSD-src-742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb.zip FreeBSD-src-742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb.tar.gz |
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
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 6508024..9c4948e 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'; |