summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm')
-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 d45162ad..f57a1cc6 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -185,7 +185,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+PKG_VERSION_LEN);
+ STRNCPY(name, ent->d_name, (PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+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)) {