]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: Fix order of arguments in reallocarray
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Nov 2024 19:57:37 +0000 (19:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Nov 2024 19:58:03 +0000 (19:58 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser.c
src/libpakfire/path.c

index 01673c63b29204264c2da94f2f90b2ff8972d63f..ec59ca7fabd739b6b96af1468e14a2ea4b8b0557 100644 (file)
@@ -341,7 +341,7 @@ int pakfire_parser_set(struct pakfire_parser* parser,
 
        // Assign new declaration to array
        parser->declarations = reallocarray(parser->declarations,
-               sizeof(*parser->declarations), parser->num_declarations + 1);
+               parser->num_declarations + 1, sizeof(*parser->declarations));
        parser->declarations[parser->num_declarations++] = d;
 
        return 0;
index 4ec117cacb7bca10015a165232cb50fe7cc40613..7893c15c6605962083028efb6637054b801aaae0 100644 (file)
@@ -64,8 +64,7 @@ static int pakfire_path_insert_segment(struct pakfire_path* path, unsigned int i
                return -ERANGE;
 
        // Make space
-       path->segments = reallocarray(path->segments, sizeof(*path->segments),
-               path->num_segments + 2);
+       path->segments = reallocarray(path->segments, path->num_segments + 2, sizeof(*path->segments));
 
        // Fail if we could not make space
        if (!path->segments)