summaryrefslogtreecommitdiff
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-07 13:01:13 -0500
committerDave Reisner <dreisner@archlinux.org>2012-04-08 22:28:45 -0400
commita8a1b093eb23450244418232c9e30c4be035fc0b (patch)
tree632a47273f1c4678984d66ecce0c41b6cb7ece1d /src/pacman/pacman.c
parentec91133e38cb7c486ec995d4183f30e84f3ca736 (diff)
Various tweaks to support building with excessive GCC warning flags
This fixes a bunch of small issues in order to enable a clean successful build with a crazy number of GCC warning flags. A lot of these changes are covered by -Wshadow, -Wformat-security, and -Wstrict-overflow=5. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 1e6797c9..73d5be94 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -808,12 +808,13 @@ int main(int argc, char *argv[])
/* we support reading targets from stdin if a cmdline parameter is '-' */
if(!isatty(fileno(stdin)) && alpm_list_find_str(pm_targets, "-")) {
- size_t current_size = PATH_MAX, i = 0;
+ size_t current_size = PATH_MAX;
char *line = malloc(current_size);
/* remove the '-' from the list */
pm_targets = alpm_list_remove_str(pm_targets, "-", NULL);
+ i = 0;
while((line[i] = (char)fgetc(stdin)) != EOF) {
if(isspace((unsigned char)line[i])) {
/* avoid adding zero length arg when multiple spaces separate args */
@@ -885,13 +886,13 @@ int main(int argc, char *argv[])
#endif
if(config->verbose > 0) {
- alpm_list_t *i;
+ alpm_list_t *j;
printf("Root : %s\n", alpm_option_get_root(config->handle));
printf("Conf File : %s\n", config->configfile);
printf("DB Path : %s\n", alpm_option_get_dbpath(config->handle));
printf("Cache Dirs: ");
- for(i = alpm_option_get_cachedirs(config->handle); i; i = alpm_list_next(i)) {
- printf("%s ", (const char *)i->data);
+ for(j = alpm_option_get_cachedirs(config->handle); j; j = alpm_list_next(j)) {
+ printf("%s ", (const char *)j->data);
}
printf("\n");
printf("Lock File : %s\n", alpm_option_get_lockfile(config->handle));