[PATCH 02/15] builtin/ls-remote.c: rearrange xcalloc arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
Rearrgange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@xxxxxxxxx>
---
 builtin/ls-remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 39e5144..aec1c0c 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -92,7 +92,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 
 	if (argv[i]) {
 		int j;
-		pattern = xcalloc(sizeof(const char *), argc - i + 1);
+		pattern = xcalloc(argc - i + 1, sizeof(const char *));
 		for (j = i; j < argc; j++) {
 			int len = strlen(argv[j]);
 			char *p = xmalloc(len + 3);
-- 
2.0.0.rc1.543.gc8042da

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]