1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 23:38:49 -05:00

Added DB_TREENAME_LEN define to avoid hardcoded length for database string

This commit is contained in:
Aurelien Foret 2005-03-16 20:23:50 +00:00
parent 57df73517f
commit 22c0037a08
2 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,7 @@ pmdb_t *db_open(char *root, char *dbpath, char *treename)
return(NULL);
}
strncpy(db->treename, treename, sizeof(db->treename)-1);
strncpy(db->treename, treename, DB_TREENAME_LEN-1);
db->pkgcache = NULL;
db->grpcache = NULL;

View File

@ -34,10 +34,12 @@
#define INFRQ_SCRIPLET 0x08
#define INFRQ_ALL 0xFF
#define DB_TREENAME_LEN 128
/* Database */
typedef struct __pmdb_t {
char *path;
char treename[128];
char treename[DB_TREENAME_LEN];
DIR *dir;
PMList *pkgcache;
PMList *grpcache;