Suppress the following compiler warning:

f2fs_format.c:1653:37: warning: adding 'int' to a string does not append to the
      string [-Wstring-plus-int]
                memcpy(dent_blk->filename[3], LPF + F2FS_SLOT_LEN,
                                              ~~~~^~~~~~~~~~~~~~~
f2fs_format.c:1653:37: note: use array indexing to silence this warning
                memcpy(dent_blk->filename[3], LPF + F2FS_SLOT_LEN,
                                                  ^
                                              &   [              ]

Signed-off-by: Bart Van Assche <bvanass...@acm.org>
---
 mkfs/f2fs_format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 173f619585f3..6f2761cfdb75 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -1650,7 +1650,7 @@ static int f2fs_add_default_dentry_root(void)
                dent_blk->dentry[2].file_type = F2FS_FT_DIR;
                memcpy(dent_blk->filename[2], LPF, F2FS_SLOT_LEN);
 
-               memcpy(dent_blk->filename[3], LPF + F2FS_SLOT_LEN,
+               memcpy(dent_blk->filename[3], &LPF[F2FS_SLOT_LEN],
                                len - F2FS_SLOT_LEN);
 
                test_and_set_bit_le(2, dent_blk->dentry_bitmap);


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to