diff options
| author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-05-04 11:28:16 +0000 |
|---|---|---|
| committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-05-04 11:28:16 +0000 |
| commit | 920b61d0bf647bbf2fed7c509de79f27b5a588a4 (patch) | |
| tree | b5a614269ca5ae1c8840fafe2984c657764367c6 /usr.bin | |
| parent | dcd61bb80cd8fe69b74b5b2048c3b5a33506b7ef (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/getent/getent.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/getent/getent.c b/usr.bin/getent/getent.c index 94e2e877b696..0694fdc751f7 100644 --- a/usr.bin/getent/getent.c +++ b/usr.bin/getent/getent.c @@ -509,10 +509,9 @@ services(int argc, char *argv[]) proto = strchr(argv[i], '/'); if (proto != NULL) *proto++ = '\0'; - if (parsenum(argv[i], &id)) { - printf("%lu %s\n", id, proto); - se = getservbyport((int)id, proto); - } else + if (parsenum(argv[i], &id)) + se = getservbyport(htons((u_short)id), proto); + else se = getservbyname(argv[i], proto); if (se != NULL) SERVICESPRINT; |
