index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-06-28 17:46:04 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-30 11:51:36 -0500 |
commit | b94e8ecd1fec4426baab8c90e7fc0d5583acdbef (patch) | |
tree | f3d4d2800610893956ccad1691509ddf53c7f487 /src | |
parent | 9efd10cd2ac9a7654b2c7c94df86bf09ab54f41a (diff) |
-rw-r--r-- | src/pacman/pacman.c | 7 |
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 9ed1c612..cd59c8d4 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -721,15 +721,18 @@ static void cl_to_log(int argc, char* argv[]) { size_t size = 0; int i; - for(i = 0; i<argc; i++) { + for(i = 0; i < argc; i++) { size += strlen(argv[i]) + 1; } + if(!size) { + return; + } char *cl_text = malloc(size); if(!cl_text) { return; } char *p = cl_text; - for(i = 0; i<argc-1; i++) { + for(i = 0; i < argc - 1; i++) { strcpy(p, argv[i]); p += strlen(argv[i]); *p++ = ' '; |