Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-05-04 15:48:47 -0500
committerDan McGee <dan@archlinux.org>2011-05-04 15:48:47 -0500
commite8a40526cb3be82c5019f0ee3f592a08b3387fa9 (patch)
treedf47b16beb2dfcfd42d2bc94379725082b653f7c /lib
parentc03faa32f335f3fb7bc1bc8718dd1781781ef3dd (diff)
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 'lib')
-rw-r--r--lib/libalpm/conflict.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 319e49d6..fbc988bd 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -287,7 +287,7 @@ static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
if(name2) {
STRDUP(conflict->ctarget, name2, RET_ERR(PM_ERR_MEMORY, NULL));
} else {
- conflict->ctarget = "";
+ STRDUP(conflict->ctarget, "", RET_ERR(PM_ERR_MEMORY, NULL));
}
conflicts = alpm_list_add(conflicts, conflict);
@@ -299,10 +299,8 @@ static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
void _alpm_fileconflict_free(pmfileconflict_t *conflict)
{
- if(strlen(conflict->ctarget) > 0) {
- FREE(conflict->ctarget);
- }
- FREE(conflict->file);;
+ FREE(conflict->ctarget);
+ FREE(conflict->file);
FREE(conflict->target);
FREE(conflict);
}