summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-05-04 22:48:47 +0200
committerDan McGee <dan@archlinux.org>2011-05-04 22:48:47 +0200
commite8a40526cb3be82c5019f0ee3f592a08b3387fa9 (patch)
treedf47b16beb2dfcfd42d2bc94379725082b653f7c /src/pacman/util.c
parentc03faa32f335f3fb7bc1bc8718dd1781781ef3dd (diff)
downloadpacman-e8a40526cb3be82c5019f0ee3f592a08b3387fa9.tar.gz
pacman-e8a40526cb3be82c5019f0ee3f592a08b3387fa9.tar.xz
Fix warnings reported by -Wwrite-strings
These are places where we stuck a string constant in a variable not marked as const. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 8d7e8e98..8631075f 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -502,12 +502,13 @@ static alpm_list_t *table_create_format(const alpm_list_t *header,
/* now use the column width info to generate format strings */
for(i = longest_strs; i; i = alpm_list_next(i)) {
+ const char *display;
colwidth = strlen(alpm_list_getdata(i)) + padding;
totalwidth += colwidth;
/* right align the last column for a cleaner table display */
- str = (alpm_list_next(i) != NULL) ? "%%-%ds" : "%%%ds";
- pm_asprintf(&formatstr, str, colwidth);
+ display = (alpm_list_next(i) != NULL) ? "%%-%ds" : "%%%ds";
+ pm_asprintf(&formatstr, display, colwidth);
formats = alpm_list_add(formats, formatstr);
}