clearer string length for a strncpy call
This commit is contained in:
parent
6063424c82
commit
e5389ddc62
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue