diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-03-29 17:20:43 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-03-29 17:20:43 +0000 |
commit | e5389ddc620bb4584a29c8e36ea1d2584f013f7f (patch) | |
tree | 48d3fed13b829fc5ebd424a91b961171b506ec3a | |
parent | 6063424c82f18f3ea8bbf9a92fd30b349ec778bd (diff) | |
download | pacman-e5389ddc620bb4584a29c8e36ea1d2584f013f7f.tar.xz |
clearer string length for a strncpy call
-rw-r--r-- | lib/libalpm/db.c | 2 |
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)) { |