>From 0b88a80e9d619f42b4e1494a2e14882b1c81640b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 9 Jul 2018 17:47:53 +0200 Subject: [PATCH] maint: use gnulib's intprops module to avoid magic numbers * bootstrap.conf (gnulib_modules): Add intprops. * find/ftsfind.c (get_fts_info_name): Use the INT_BUFSIZE_BOUND macro to calculate the size of BUF. --- bootstrap.conf | 1 + find/ftsfind.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index cfa839a1..099b9311 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -114,6 +114,7 @@ gnulib_modules=" human idcache inline + intprops inttypes isblank locale diff --git a/find/ftsfind.c b/find/ftsfind.c index 57804950..39fdfbff 100644 --- a/find/ftsfind.c +++ b/find/ftsfind.c @@ -42,6 +42,7 @@ #include "closeout.h" #include "error.h" #include "fts_.h" +#include "intprops.h" #include "progname.h" #include "quotearg.h" #include "save-cwd.h" @@ -143,7 +144,7 @@ static void init_mounted_dev_list (void); static const char * get_fts_info_name (int info) { - static char buf[14]; + static char buf[1 + INT_BUFSIZE_BOUND (info) + 1]; switch (info) { HANDLECASE(FTS_D); -- 2.18.0