btrfs-progs: image: fix non-printable characters in generated file names

Function find_collision sometimes generated file names with non-printable
DEL characters (code 127), for example file name "|5gp!" would be changed
to "U'2<DEL>y" when using "crc-collisions" sanitize mode.

Author: Piotr Pawlow <pp@siedziba.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Piotr Pawlow 2017-08-11 17:11:44 +02:00 committed by David Sterba
parent c5b6e3fad8
commit 658e7b897b

View file

@ -387,12 +387,12 @@ static char *find_collision(struct metadump_struct *md, char *name,
break;
}
if (val->sub[i] == 127) {
if (val->sub[i] == 126) {
do {
i++;
if (i >= name_len)
break;
} while (val->sub[i] == 127);
} while (val->sub[i] == 126);
if (i >= name_len)
break;