summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2012-02-05 01:40:48 -0500
committerGravatar Karl Ramm <kcr@1ts.org>2012-02-05 01:40:48 -0500
commitbbad55928d5bbf583953ddd588668337c50cd214 (patch)
tree3804e8713d3365bb68126993279eb72335052a92
parenta822b2f2c36c4ee08e968eacf994cc1131ccfbf9 (diff)
Kill off another MAXPATHLEN
-rw-r--r--lib/ZLocations.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ZLocations.c b/lib/ZLocations.c
index b0c197c..95e180a 100644
--- a/lib/ZLocations.c
+++ b/lib/ZLocations.c
@@ -20,7 +20,7 @@ static const char rcsid_ZLocations_c[] =
#include <pwd.h>
-static char host[NS_MAXDNAME], mytty[MAXPATHLEN];
+static char host[NS_MAXDNAME], *mytty = "space";
static int location_info_set = 0;
Code_t
@@ -42,16 +42,18 @@ ZInitLocationInfo(char *hostname,
}
}
if (tty) {
- strcpy(mytty, tty);
+ mytty = strdup(tty);
} else {
ttyp = ttyname(0);
if (ttyp && *ttyp) {
p = strchr(ttyp + 1, '/');
- strcpy(mytty, (p) ? p + 1 : ttyp);
+ mytty = strdup(p ? p + 1 : ttyp);
} else {
- strcpy(mytty, "unknown");
+ mytty = strdup("unknown");
}
}
+ if (mytty == NULL)
+ return errno;
location_info_set = 1;
return (ZERR_NONE);
}