summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger/net.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-07-02 06:34:51 +0000
committercharnier <charnier@FreeBSD.org>1997-07-02 06:34:51 +0000
commit4f0a8d27eade450177c40030a521bf36e928072c (patch)
treebd9c4e7b5fb6ade49d178792a0d7cc84b4bbeb01 /usr.bin/finger/net.c
parent71f3417bb9e62e466a658f021e5f0c468abfe767 (diff)
downloadFreeBSD-src-4f0a8d27eade450177c40030a521bf36e928072c.zip
FreeBSD-src-4f0a8d27eade450177c40030a521bf36e928072c.tar.gz
Add rcsid, usage(). Silent -Wall. Use warn(3).
Diffstat (limited to 'usr.bin/finger/net.c')
-rw-r--r--usr.bin/finger/net.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c
index 1173847..e4bbfc6 100644
--- a/usr.bin/finger/net.c
+++ b/usr.bin/finger/net.c
@@ -35,7 +35,12 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)net.c 8.4 (Berkeley) 4/28/95";
+#else
+static const char rcsid[] =
+ "$Id$";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -44,6 +49,7 @@ static char sccsid[] = "@(#)net.c 8.4 (Berkeley) 4/28/95";
#include <arpa/inet.h>
#include <netdb.h>
#include <db.h>
+#include <err.h>
#include <unistd.h>
#include <pwd.h>
#include <utmp.h>
@@ -72,7 +78,7 @@ netfinger(name)
if (!(host = rindex(name, '@')))
return;
- *host++ = NULL;
+ *host++ = '\0';
if (isdigit(*host) && (defaddr.s_addr = inet_addr(host)) != -1) {
def.h_name = host;
def.h_addr_list = alist;
@@ -82,12 +88,11 @@ netfinger(name)
def.h_aliases = 0;
hp = &def;
} else if (!(hp = gethostbyname(host))) {
- (void)fprintf(stderr,
- "finger: unknown host: %s\n", host);
+ warnx("unknown host: %s", host);
return;
}
if (!(sp = getservbyname("finger", "tcp"))) {
- (void)fprintf(stderr, "finger: tcp/finger: unknown service\n");
+ warnx("tcp/finger: unknown service");
return;
}
sin.sin_family = hp->h_addrtype;
OpenPOWER on IntegriCloud