libsframe: Fix calloc argument order in dump_sframe_header

GCC14 warns about the order of the arguments to calloc

libsframe/sframe-dump.c: In function ‘dump_sframe_header’:
libsframe/sframe-dump.c:70:39: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
   70 |   flags_str = (char*) calloc (sizeof (char), SFRAME_HEADER_FLAGS_STR_MAX_LEN);
      |                                       ^~~~
libsframe/sframe-dump.c:70:39: note: earlier argument should specify number of elements, later size of each element

Fix this by swapping the size and count arguments.

libsframe/

	* sframe-dump.c (dump_sframe_header): Swap arguments to calloc
This commit is contained in:
Mark Wielaard 2024-01-22 00:12:45 +01:00
parent 5bc519bf0c
commit aa5a36b118

View File

@ -67,7 +67,7 @@ dump_sframe_header (sframe_decoder_ctx *sfd_ctx)
/* Prepare SFrame section flags string. */
flags = header->sfh_preamble.sfp_flags;
flags_str = (char*) calloc (sizeof (char), SFRAME_HEADER_FLAGS_STR_MAX_LEN);
flags_str = (char*) calloc (SFRAME_HEADER_FLAGS_STR_MAX_LEN, sizeof (char));
if (flags)
{
if (flags & SFRAME_F_FDE_SORTED)