summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2012-04-10 16:41:11 +0000
committerEric Faurot <eric@cvs.openbsd.org>2012-04-10 16:41:11 +0000
commitc6900fb1f3331136ab15d1da06a8a195e60ba369 (patch)
treeeb2342b235a82fb64aacd8d004cb002d2f105d23
parentb6236a9bf12e3116d065954919d55d2f05dd5798 (diff)
Do not pick the network number as alias on entries with no alias
defined. ok deraadt@
-rw-r--r--lib/libc/net/getnetent.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/net/getnetent.c b/lib/libc/net/getnetent.c
index 1bec6fb98ce..57fe459e2bb 100644
--- a/lib/libc/net/getnetent.c
+++ b/lib/libc/net/getnetent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetent.c,v 1.12 2006/01/17 15:37:58 millert Exp $ */
+/* $OpenBSD: getnetent.c,v 1.13 2012/04/10 16:41:10 eric Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -100,8 +100,7 @@ again:
net.n_net = inet_network(cp);
net.n_addrtype = AF_INET;
q = net.n_aliases = net_aliases;
- if (p != NULL)
- cp = p;
+ cp = p;
while (cp && *cp) {
if (*cp == ' ' || *cp == '\t') {
cp++;