]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: clean up gcc -Wall warning from using snprintf
authorTheodore Ts'o <tytso@mit.edu>
Sun, 14 Jul 2019 14:41:36 +0000 (10:41 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 14 Jul 2019 14:41:36 +0000 (10:41 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/ls.c

index 4f63bd3fd92af1d6ea0bf97ec38444ab9b407d3d..ae8b2d39d48df6fded355c43d632154e7c429f27 100644 (file)
@@ -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, "<encrypted (%d)>", len);
-               else {
-                       char tmp[1];
-                       return snprintf(tmp, sizeof(tmp),
-                                       "<encrypted (%d)>", len);
-               }
+               else
+                       return snprintf(NULL, 0, "<encrypted (%d)>", len);
        }
        while (len--) {
                ch = *cp++;