summaryrefslogtreecommitdiffstats
path: root/term-utils/write.c
diff options
context:
space:
mode:
authorThomas Schwinge2012-05-25 20:16:16 +0200
committerKarel Zak2012-05-29 10:11:37 +0200
commite78a7ecd4fb4d52d041ce3380638347124d6694c (patch)
tree4ebbda751ef36b8973a103790a29a1b2856b9422 /term-utils/write.c
parentlogin: Include <linux/major.h> only if it exists. (diff)
downloadkernel-qcow2-util-linux-e78a7ecd4fb4d52d041ce3380638347124d6694c.tar.gz
kernel-qcow2-util-linux-e78a7ecd4fb4d52d041ce3380638347124d6694c.tar.xz
kernel-qcow2-util-linux-e78a7ecd4fb4d52d041ce3380638347124d6694c.zip
write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'term-utils/write.c')
-rw-r--r--term-utils/write.c6
1 files changed, 3 insertions, 3 deletions
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)