summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/getservbyport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/getservbyport.c')
-rw-r--r--src/lib/libc/net/getservbyport.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/libc/net/getservbyport.c b/src/lib/libc/net/getservbyport.c
index c34790737b..4b063760d2 100644
--- a/src/lib/libc/net/getservbyport.c
+++ b/src/lib/libc/net/getservbyport.c
@@ -1,5 +1,3 @@
1/* $NetBSD: getservbyport.c,v 1.4 1995/02/25 06:20:37 cgd Exp $ */
2
3/* 1/*
4 * Copyright (c) 1983, 1993 2 * Copyright (c) 1983, 1993
5 * The Regents of the University of California. All rights reserved. 3 * The Regents of the University of California. All rights reserved.
@@ -34,11 +32,7 @@
34 */ 32 */
35 33
36#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
37#if 0 35static char rcsid[] = "$OpenBSD: getservbyport.c,v 1.3 1997/07/09 01:08:35 millert Exp $";
38static char sccsid[] = "@(#)getservbyport.c 8.1 (Berkeley) 6/4/93";
39#else
40static char rcsid[] = "$NetBSD: getservbyport.c,v 1.4 1995/02/25 06:20:37 cgd Exp $";
41#endif
42#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
43 37
44#include <netdb.h> 38#include <netdb.h>
@@ -54,7 +48,7 @@ getservbyport(port, proto)
54 register struct servent *p; 48 register struct servent *p;
55 49
56 setservent(_serv_stayopen); 50 setservent(_serv_stayopen);
57 while (p = getservent()) { 51 while ((p = getservent())) {
58 if (p->s_port != port) 52 if (p->s_port != port)
59 continue; 53 continue;
60 if (proto == 0 || strcmp(p->s_proto, proto) == 0) 54 if (proto == 0 || strcmp(p->s_proto, proto) == 0)