From e78a7ecd4fb4d52d041ce3380638347124d6694c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 25 May 2012 20:16:16 +0200 Subject: write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere. Signed-off-by: Thomas Schwinge --- term-utils/write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'term-utils/write.c') diff --git a/term-utils/write.c b/term-utils/write.c index 2a94792e0..7fe88e1b5 100644 --- a/term-utils/write.c +++ b/term-utils/write.c @@ -94,7 +94,7 @@ int main(int argc, char **argv) time_t atime; uid_t myuid; int msgsok, myttyfd, c; - char tty[MAXPATHLEN], *mytty; + char tty[PATH_MAX], *mytty; static const struct option longopts[] = { {"version", no_argument, NULL, 'V'}, @@ -288,7 +288,7 @@ void search_utmp(char *user, char *tty, char *mytty, uid_t myuid) int term_chk(char *tty, int *msgsokP, time_t * atimeP, int showerror) { struct stat s; - char path[MAXPATHLEN]; + char path[PATH_MAX]; if (strlen(tty) + 6 > sizeof(path)) return 1; @@ -313,7 +313,7 @@ void do_write(char *tty, char *mytty, uid_t myuid) char *login, *pwuid, *nows; struct passwd *pwd; time_t now; - char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512]; + char path[PATH_MAX], host[MAXHOSTNAMELEN], line[512]; /* Determine our login name(s) before the we reopen() stdout */ if ((pwd = getpwuid(myuid)) != NULL) -- cgit v1.2.3-55-g7522