From e8a40526cb3be82c5019f0ee3f592a08b3387fa9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 4 May 2011 15:48:47 -0500 Subject: 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 --- src/pacman/package.c | 2 +- src/pacman/util.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/pacman') diff --git a/src/pacman/package.c b/src/pacman/package.c index 335b8b6d..e256dda5 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -153,7 +153,7 @@ static const char *get_backup_file_status(const char *root, const char *filename, const char *expected_md5) { char path[PATH_MAX]; - char *ret; + const char *ret; snprintf(path, PATH_MAX, "%s%s", root, filename); 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); } -- cgit v1.2.3-70-g09d2