summaryrefslogtreecommitdiff
path: root/lib/ZLocations.c
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2010-08-24 07:08:36 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2010-08-24 07:08:36 +0000
commitdef9f9a0706a18cb1bc0f44b39d55e4e81c788ff (patch)
tree9418608ac360d3f35f8318b05a9b292676ffc2f9 /lib/ZLocations.c
parentd5f3280d24efcdc24c861c26a4c32e967e16eee2 (diff)
stop using MAXHOSTNAMELEN in a variety of places. Also nuke-trailing-whitespace.
Diffstat (limited to 'lib/ZLocations.c')
-rw-r--r--lib/ZLocations.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ZLocations.c b/lib/ZLocations.c
index db6daa6..b0c197c 100644
--- a/lib/ZLocations.c
+++ b/lib/ZLocations.c
@@ -8,7 +8,7 @@
*
* Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
- * "mit-copyright.h".
+ * "mit-copyright.h".
*/
#ifndef lint
@@ -20,7 +20,7 @@ static const char rcsid_ZLocations_c[] =
#include <pwd.h>
-static char host[MAXHOSTNAMELEN], mytty[MAXPATHLEN];
+static char host[NS_MAXDNAME], mytty[MAXPATHLEN];
static int location_info_set = 0;
Code_t
@@ -33,7 +33,7 @@ ZInitLocationInfo(char *hostname,
if (hostname) {
strcpy(host, hostname);
} else {
- if (gethostname(host, MAXHOSTNAMELEN) < 0)
+ if (gethostname(host, sizeof(host)) < 0)
return (errno);
hent = gethostbyname(host);
if (hent) {
@@ -59,14 +59,14 @@ ZInitLocationInfo(char *hostname,
Code_t
ZSetLocation(char *exposure)
{
- return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH,
+ return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH,
"$sender logged in to $1 on $3 at $2"));
}
Code_t
ZUnsetLocation(void)
{
- return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH,
+ return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH,
"$sender logged out of $1 on $3 at $2"));
}
@@ -158,8 +158,8 @@ Z_SendLocation(char *class,
}
ZFreeNotice(&retnotice);
return (ZERR_SERVNAK);
- }
-
+ }
+
if (retnotice.z_kind != SERVACK) {
ZFreeNotice(&retnotice);
return (ZERR_INTERNAL);
@@ -177,6 +177,6 @@ Z_SendLocation(char *class,
}
ZFreeNotice(&retnotice);
-
+
return (ZERR_NONE);
}