From b27f1916792ceed3eedfc2bc9121ddf43a165f6c Mon Sep 17 00:00:00 2001 From: Kacper Kulczycki Date: Fri, 22 Jun 2018 19:18:25 +0200 Subject: [PATCH] PhotoRec: avoid more bad chars in filenames --- src/filegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filegen.c b/src/filegen.c index 95685433..f48f21d0 100644 --- a/src/filegen.c +++ b/src/filegen.c @@ -429,7 +429,7 @@ int file_rename(file_recovery_t *file_recovery, const void *buffer, const int bu bad++; break; default: - if(isprint(*src) && !isspace(*src)) + if(isprint(*src) && !isspace(*src) && !ispunct(*src) && !iscntrl(*src)) { *dst++ = *src; ok++; @@ -542,7 +542,7 @@ int file_rename_unicode(file_recovery_t *file_recovery, const void *buffer, cons bad++; break; default: - if(isprint(*src) && !isspace(*src)) + if(isprint(*src) && !isspace(*src) && !ispunct(*src) && !iscntrl(*src)) { *dst++ = *src; ok++;