From 025b3581ae241150dfc8e24f6a7bae413f8c72b2 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 21 Nov 2014 22:28:34 +0000 Subject: [PATCH] Replace MAXPATHLEN with PATH_MAX MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter. * strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX. * util.c (printpathn, printpath): Likewise. --- strace.c | 6 +++--- util.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/strace.c b/strace.c index cb967585..aae7505f 100644 --- a/strace.c +++ b/strace.c @@ -1161,7 +1161,7 @@ startup_child(char **argv) { struct_stat statbuf; const char *filename; - char pathname[MAXPATHLEN]; + char pathname[PATH_MAX]; int pid; struct tcb *tcp; @@ -1195,7 +1195,7 @@ startup_child(char **argv) else m = n = strlen(path); if (n == 0) { - if (!getcwd(pathname, MAXPATHLEN)) + if (!getcwd(pathname, PATH_MAX)) continue; len = strlen(pathname); } @@ -1308,7 +1308,7 @@ startup_child(char **argv) * instead of call (won't push anything to stack), * (2) by trying very hard in exec_or_die() * to not use any stack, - * (3) having a really big (MAXPATHLEN) stack object + * (3) having a really big (PATH_MAX) stack object * in this function, which creates a "buffer" between * child's and parent's stack pointers. * This may save us if (1) and (2) failed diff --git a/util.c b/util.c index e05efcd8..4f637e83 100644 --- a/util.c +++ b/util.c @@ -598,7 +598,7 @@ string_quote(const char *instr, char *outstr, long len, int size) void printpathn(struct tcb *tcp, long addr, unsigned int n) { - char path[MAXPATHLEN + 1]; + char path[PATH_MAX + 1]; int nul_seen; if (!addr) { @@ -631,7 +631,7 @@ void printpath(struct tcb *tcp, long addr) { /* Size must correspond to char path[] size in printpathn */ - printpathn(tcp, addr, MAXPATHLEN); + printpathn(tcp, addr, PATH_MAX); } /* -- 2.40.0