clearer string length for a strncpy call

This commit is contained in:
Aurelien Foret 2005-03-29 17:20:43 +00:00
parent 6063424c82
commit e5389ddc62
1 changed files with 1 additions and 1 deletions

View File

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