f2fs-tools: fix calloc() calls with transposed arguments
GCC 14 and later warn about a calloc() call that has sizeof() in the
first argument and not in the second one, and the CI builds with
-Wextra -Werror:
libf2fs.c: In function 'utf8_to_utf16':
libf2fs.c:127:47: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
127 | uint16_t *volume_name = calloc(sizeof(uint16_t), MAX_VOLUME_NAME);
| ^~~~~~~~
libf2fs.c:127:47: note: earlier argument should specify number of elements, later size of each element
Pass the number of elements first and the size of an element second in
all the calls that the compiler reports. No functional change.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
4 files changed