From bbad55928d5bbf583953ddd588668337c50cd214 Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Sun, 5 Feb 2012 01:40:48 -0500 Subject: Kill off another MAXPATHLEN --- lib/ZLocations.c | 10 ++++++---- 1 file 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 -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); } -- cgit v1.2.3