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 --- lib/libalpm/conflict.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/libalpm/conflict.c') 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); } -- cgit v1.2.3-24-g4f1b