1
0
mirror of https://github.com/slicer69/doas synced 2024-07-09 03:55:50 +00:00

Minor update to switch from int to size_t for number of

rules. Reflects upstream change.
This commit is contained in:
Jesse Smith 2021-01-27 15:17:25 -04:00
parent be85cdabda
commit 929ab00b25
2 changed files with 4 additions and 4 deletions

2
doas.h
View File

@ -26,7 +26,7 @@ struct rule {
};
extern struct rule **rules;
extern int nrules;
extern size_t nrules;
extern int parse_errors;
struct passwd;

View File

@ -48,8 +48,8 @@ typedef struct {
FILE *yyfp;
struct rule **rules;
int nrules;
static int maxrules;
size_t nrules = 0;
static size_t maxrules = 0;
int parse_errors = 0;
@ -96,7 +96,7 @@ rule: action ident target cmd {
r->cmdargs = $4.cmdargs;
if (nrules == maxrules) {
if (maxrules == 0)
maxrules = 63;
maxrules = 32;
else
maxrules *= 2;
if (!(rules = reallocarray(rules, maxrules,