summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-10-08 21:36:47 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-10-08 21:36:47 +0000
commit8ffb82a691d08511e7436ba0f2fc63f8822e9a4e (patch)
tree5e2c8824daac847d37eaade52b810fa0794710ff /lib/libalpm/db.c
parent05ab859eab8dbe14f1957d0a4e64b3f005630d45 (diff)
downloadpacman-8ffb82a691d08511e7436ba0f2fc63f8822e9a4e.tar.xz
Code update to make use of PKG_FULLNAME_LEN
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 60850489..139bc3bb 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -181,7 +181,7 @@ pmpkg_t *db_scan(pmdb_t *db, char *target, unsigned int inforeq)
struct dirent *ent = NULL;
struct stat sbuf;
char path[PATH_MAX];
- char name[(PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+1];
+ char name[PKG_FULLNAME_LEN];
char *ptr = NULL;
int found = 0;
pmpkg_t *pkg;
@@ -197,7 +197,7 @@ pmpkg_t *db_scan(pmdb_t *db, char *target, unsigned int inforeq)
if(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) {
continue;
}
- STRNCPY(name, ent->d_name, (PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+1);
+ STRNCPY(name, ent->d_name, PKG_FULLNAME_LEN);
/* stat the entry, make sure it's a directory */
snprintf(path, PATH_MAX, "%s/%s", db->path, name);
if(stat(path, &sbuf) || !S_ISDIR(sbuf.st_mode)) {