From: Theodore Ts'o Date: Sun, 14 Jul 2019 14:41:36 +0000 (-0400) Subject: debugfs: clean up gcc -Wall warning from using snprintf X-Git-Tag: v1.45.3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b96524174f31490d59e4d6ba77b1e2e34be950d;p=thirdparty%2Fe2fsprogs.git debugfs: clean up gcc -Wall warning from using snprintf Signed-off-by: Theodore Ts'o --- diff --git a/debugfs/ls.c b/debugfs/ls.c index 4f63bd3fd..ae8b2d39d 100644 --- a/debugfs/ls.c +++ b/debugfs/ls.c @@ -54,11 +54,8 @@ static int print_filename(FILE *f, struct ext2_dir_entry *dirent, int options) if ((options & ENCRYPT_OPT) && !(options & RAW_OPT)) { if (f) return fprintf(f, "", len); - else { - char tmp[1]; - return snprintf(tmp, sizeof(tmp), - "", len); - } + else + return snprintf(NULL, 0, "", len); } while (len--) { ch = *cp++;