From: Thomas Schwinge Date: Fri, 25 May 2012 18:16:16 +0000 (+0200) Subject: write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere. X-Git-Tag: v2.22-rc1~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e78a7ecd4fb4d52d041ce3380638347124d6694c;p=thirdparty%2Futil-linux.git write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere. Signed-off-by: Thomas Schwinge --- diff --git a/term-utils/write.c b/term-utils/write.c index 2a94792e00..7fe88e1b56 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)