summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-16 23:57:12 +0100
committerAurelien Foret <aurelien@archlinux.org>2005-03-16 23:57:12 +0100
commit7a01ed50b903f24ba44ce9bb9a591460b6a2be64 (patch)
treea8e9ddf63fead14cd5b26707c7bdee9171045d5a /lib/libalpm/alpm.c
parentd10955065632a67fcad70e32d36eeb80b1045299 (diff)
downloadpacman-7a01ed50b903f24ba44ce9bb9a591460b6a2be64.tar.gz
pacman-7a01ed50b903f24ba44ce9bb9a591460b6a2be64.tar.xz
Removed hardcoded reference to fields of packages
Diffstat (limited to 'lib/libalpm/alpm.c')
-rw-r--r--lib/libalpm/alpm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index e564d31c..8dc8f0b1 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -291,18 +291,18 @@ void *alpm_pkg_getinfo(PM_PKG *pkg, unsigned char parm)
case PM_PKG_FILES:
case PM_PKG_BACKUP:
if(!(pkg->infolevel & INFRQ_FILES)) {
- char target[321]; /* 256+1+64 */
+ char target[PKG_NAME_LEN+1+PKG_VERSION_LEN];
- snprintf(target, 321, "%s-%s", pkg->name, pkg->version);
+ snprintf(target, PKG_NAME_LEN+1+PKG_VERSION_LEN, "%s-%s", pkg->name, pkg->version);
db_read(pkg->data, target, INFRQ_FILES, pkg);
}
break;
case PM_PKG_SCRIPLET:
if(!(pkg->infolevel & INFRQ_SCRIPLET)) {
- char target[321];
+ char target[PKG_NAME_LEN+1+PKG_VERSION_LEN];
- snprintf(target, 321, "%s-%s", pkg->name, pkg->version);
+ snprintf(target, PKG_NAME_LEN+1+PKG_VERSION_LEN, "%s-%s", pkg->name, pkg->version);
db_read(pkg->data, target, INFRQ_SCRIPLET, pkg);
}
break;