[PATCH 1/1] fat: correct sign for deletion mark
Simon Glass
sjg at chromium.org
Thu Jul 27 02:50:08 CEST 2023
On Wed, 26 Jul 2023 at 02:33, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> 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 at linaro.org>
> Fixes: 57b745e2387a ("fs: fat: call set_name() only once")
> Fixes: 28cef9ca2e86 ("fs: fat: create correct short names")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> fs/fat/fat_write.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
Could we have a test for this?
More information about the U-Boot
mailing list