summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-19 18:56:22 +0100
committerAurelien Foret <aurelien@archlinux.org>2005-03-19 18:56:22 +0100
commit0a072b57c521d763aa2f4d8918987a26c9ea5124 (patch)
treecb9b3241654dd8cbc7f83720d9d2aa236d842095 /lib
parent0d69a4aeb077775288ada9cb418993f20a6060e3 (diff)
downloadpacman-0a072b57c521d763aa2f4d8918987a26c9ea5124.tar.gz
pacman-0a072b57c521d763aa2f4d8918987a26c9ea5124.tar.xz
Removed an hardcoded string length
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 922aeaea..c555f256 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -159,7 +159,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, 255);
+ strncpy(name, ent->d_name, PKG_NAME_LEN+PKG_VERSION_LEN-1);
/* 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)) {