Skip to content

Commit edd2d84

Browse files
modocachegitster
authored andcommitted
builtin/ls-remote.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size. cmd_ls_remote() passes the arguments in reverse order, passing the size of a char*, followed by the number of char* to be allocated. Rearrange them so they are in the correct order. Signed-off-by: Brian Gesiak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4a28f16 commit edd2d84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/ls-remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
9292

9393
if (argv[i]) {
9494
int j;
95-
pattern = xcalloc(sizeof(const char *), argc - i + 1);
95+
pattern = xcalloc(argc - i + 1, sizeof(const char *));
9696
for (j = i; j < argc; j++) {
9797
int len = strlen(argv[j]);
9898
char *p = xmalloc(len + 3);

0 commit comments

Comments
 (0)