summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-08-08 20:45:46 +0200
committerDan McGee <dan@archlinux.org>2008-08-08 20:45:46 +0200
commit57393eb730641ca912a421b70897fcd289c44b21 (patch)
treef22ac9677e5b2408efcfc635c60902b5b792b9b4 /lib/libalpm
parentf201f107dbee25294aa7c7f1139bf521e6afa267 (diff)
downloadpacman-57393eb730641ca912a421b70897fcd289c44b21.tar.gz
pacman-57393eb730641ca912a421b70897fcd289c44b21.tar.xz
Fix variable naming issues in _alpm_db_cmp
When this function got a rewrite in commit f43805d875, argument and variable names got a bit mixed up when separating the casts from the strcmp operation. Fix the mixup which also fixes a possible segfault when this function is called. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/db.c4
-rw-r--r--lib/libalpm/db.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index d9a3931e..191c8ba0 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -358,8 +358,8 @@ void _alpm_db_free(pmdb_t *db)
int _alpm_db_cmp(const void *d1, const void *d2)
{
- pmdb_t *db1 = (pmdb_t *)db1;
- pmdb_t *db2 = (pmdb_t *)db2;
+ pmdb_t *db1 = (pmdb_t *)d1;
+ pmdb_t *db2 = (pmdb_t *)d2;
return(strcmp(db1->treename, db2->treename));
}
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index eb0af1ae..96fac0dd 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -50,7 +50,7 @@ struct __pmdb_t {
/* db.c, database general calls */
pmdb_t *_alpm_db_new(const char *dbpath, const char *treename);
void _alpm_db_free(pmdb_t *db);
-int _alpm_db_cmp(const void *db1, const void *db2);
+int _alpm_db_cmp(const void *d1, const void *d2);
alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles);
pmdb_t *_alpm_db_register_local(void);
pmdb_t *_alpm_db_register_sync(const char *treename);