diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-08-01 14:19:53 -0700 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-08-04 14:23:58 +1000 |
commit | d981f93f18449e2cb7b67bfb417aac4737c84b57 (patch) | |
tree | 32b3a5b0eeb8155c6118378da91d16c96b920e07 | |
parent | 4ccf49d3e74bf2af010fc90d9cd6fbeb71402f99 (diff) |
sync.c: fix style violations
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r-- | src/pacman/sync.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c index bf19d576..46091863 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -600,11 +600,12 @@ static int process_group(alpm_list_t *dbs, const char *group, int error) } if(config->print == 0) { + char *array = malloc(count); + int n = 0; colon_printf(_n("There is %d member in group %s:\n", "There are %d members in group %s:\n", count), count, group); select_display(pkgs); - char *array = malloc(count); if(!array) { ret = 1; goto cleanup; @@ -614,12 +615,13 @@ static int process_group(alpm_list_t *dbs, const char *group, int error) free(array); goto cleanup; } - int n = 0; - for(i = pkgs; i; i = alpm_list_next(i)) { - if(array[n++] == 0) - continue; + for(i = pkgs, n = 0; i; i = alpm_list_next(i)) { alpm_pkg_t *pkg = i->data; + if(array[n++] == 0) { + continue; + } + if(process_pkg(pkg) == 1) { ret = 1; free(array); |