1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-15 13:55:09 -05:00

Removed an hardcoded string length

This commit is contained in:
Aurelien Foret 2005-03-19 17:56:22 +00:00
parent 0d69a4aeb0
commit 0a072b57c5

View File

@ -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)) {