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:
parent
57df73517f
commit
22c0037a08
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user