]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 25 May 2012 18:16:16 +0000 (20:16 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 May 2012 08:11:37 +0000 (10:11 +0200)
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
term-utils/write.c

index 2a94792e004d67457b23517ef2bf753990d6e40b..7fe88e1b56daeeb6ffdc662fc1fb0bccbc0f1a8b 100644 (file)
@@ -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)