diff options
author | Dan McGee <dan@archlinux.org> | 2007-10-31 17:37:49 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-04 16:50:59 +0100 |
commit | ab91cef65503e3162d33146414cb901c6cb60597 (patch) | |
tree | d4068a02aee9b652687b85073733558cd344b06d | |
parent | dea9b3bc0f6ba49aec8452958f5373fbb20e7df2 (diff) | |
download | pacman-ab91cef65503e3162d33146414cb901c6cb60597.tar.gz pacman-ab91cef65503e3162d33146414cb901c6cb60597.tar.xz |
Add a little const correctness fix to alpm_list
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | lib/libalpm/alpm_list.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c index 64877530..faeecc0a 100644 --- a/lib/libalpm/alpm_list.c +++ b/lib/libalpm/alpm_list.c @@ -346,7 +346,7 @@ alpm_list_t SYMEXPORT *alpm_list_remove_node(alpm_list_t *node) * @return a new list containing non-duplicate items */ alpm_list_t SYMEXPORT *alpm_list_remove_dupes(const alpm_list_t *list) -{ /* TODO does removing the strdup here cause invalid free's anywhere? */ +{ const alpm_list_t *lp = list; alpm_list_t *newlist = NULL; while(lp) { @@ -426,8 +426,9 @@ alpm_list_t SYMEXPORT *alpm_list_copy_data(const alpm_list_t *list) * @return a new list in reverse order */ alpm_list_t SYMEXPORT *alpm_list_reverse(alpm_list_t *list) -{ /* TODO any invalid free's from NOT duplicating data here? */ - alpm_list_t *lp, *newlist = NULL; +{ + const alpm_list_t *lp; + alpm_list_t *newlist = NULL; lp = alpm_list_last(list); while(lp) { |