From 0a072b57c521d763aa2f4d8918987a26c9ea5124 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sat, 19 Mar 2005 17:56:22 +0000 Subject: Removed an hardcoded string length --- 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 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)) { -- cgit v1.2.3