commit:     6ece6b56bb33e8972d76b96848c0155fefc9772f
Author:     Emanuele Torre <torreemanuele6 <AT> gmail <DOT> com>
AuthorDate: Thu Sep  5 11:39:35 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Apr 18 20:50:16 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6ece6b56

qgrep: fix -Wcalloc-transposed-args warning

I get this warning when compiling portage-utils with
gcc (Gentoo 14.2.1_p20240817 p4) 14.2.1 20240817

Closes: https://github.com/gentoo/portage-utils/pull/30
Signed-off-by: Emanuele Torre <torreemanuele6 <AT> gmail.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qgrep.c b/qgrep.c
index 699f35b..ad7a126 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -555,7 +555,7 @@ int qgrep_main(int argc, char **argv)
 
        if (argc > (optind + 1)) {
                depend_atom **d = args.include_atoms =
-                       xcalloc(sizeof(depend_atom *), (argc - optind - 1) + 1);
+                       xcalloc((argc - optind - 1) + 1, sizeof(depend_atom *));
                for (i = (optind + 1); i < argc; i++) {
                        *d = atom_explode(argv[i]);
                        if (*d == NULL) {

Reply via email to