diff options
author | Hyunchul Lee <cheol.lee@lge.com> | 2017-03-15 04:31:04 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2017-03-30 10:27:47 +0300 |
commit | e328379a18c5293c123bc56c32f19f9365384686 (patch) | |
tree | b5d7fc0e8fa66cd8f944bad0589d39e55e564d90 | |
parent | b20e2d9999506bb445e9958efa407e84d1a579cc (diff) | |
download | linux-e328379a18c5293c123bc56c32f19f9365384686.tar.xz |
ubifs: Fix debug messages for an invalid filename in ubifs_dump_node
if a character is not printable, print '?' instead of that.
Signed-off-by: Hyunchul Lee <cheol.lee@lge.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r-- | fs/ubifs/debug.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 1e712a364680..b14c06f47a96 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -32,6 +32,7 @@ #include <linux/math64.h> #include <linux/uaccess.h> #include <linux/random.h> +#include <linux/ctype.h> #include "ubifs.h" static DEFINE_SPINLOCK(dbg_lock); @@ -464,7 +465,8 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) pr_err("(bad name length, not printing, bad or corrupted node)"); else { for (i = 0; i < nlen && dent->name[i]; i++) - pr_cont("%c", dent->name[i]); + pr_cont("%c", isprint(dent->name[i]) ? + dent->name[i] : '?'); } pr_cont("\n"); |