fs/romfs: fix read file mismatch when the length of file name is 16

romfs: file name must end with '\0'

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2022-03-01 15:37:46 +08:00 committed by Alan Carvalho de Assis
parent 224241bd0a
commit 2197fb2b51

View File

@ -1173,7 +1173,7 @@ int romfs_datastart(FAR struct romfs_mountpt_s *rm,
{
#ifdef CONFIG_FS_ROMFS_CACHE_NODE
*start = ROMFS_ALIGNUP(nodeinfo->rn_offset +
ROMFS_FHDR_NAME + nodeinfo->rn_namesize);
ROMFS_FHDR_NAME + nodeinfo->rn_namesize + 1);
return OK;
#else
uint32_t offset = nodeinfo->rn_offset;