From e5389ddc620bb4584a29c8e36ea1d2584f013f7f Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 29 Mar 2005 17:20:43 +0000 Subject: clearer string length for a strncpy call --- lib/libalpm/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/db.c') 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)) { -- cgit v1.2.3-24-g4f1b