]> git.baikalelectronics.ru Git - uboot.git/commit
fat: correct sign for deletion mark
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 26 Jul 2023 08:33:13 +0000 (10:33 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 3 Aug 2023 19:30:53 +0000 (15:30 -0400)
commit0c8463f9bf636586250ae738f87f88696b11a82d
treeae534b7746df6d94d7b49dfc663c43c5f84da7ea
parentd248fcfb9a078bac346ae078208839accd09a4fc
fat: correct sign for deletion mark

The FAT file systems uses character '\xe5' to mark a deleted directory
entry. If a file name starts with this character, it is substituted by
'\x05' in the directory entry.

While (signed char)'\xe5' is a negative number 0xe5 is a positive integer
number. We therefore have define a constant DELETED_MARK which matches the
signedness of the characters in the directory entry.

Correct a comparison where we used the constant 0xe5 with the wrong sign.
Use the constant aRING instead of 0x05 like in the rest of the code.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 4488c7794dc4 ("fs: fat: call set_name() only once")
Fixes: f8e131afe6a6 ("fs: fat: create correct short names")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
fs/fat/fat_write.c