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:
parent
be85cdabda
commit
929ab00b25
2
doas.h
2
doas.h
|
@ -26,7 +26,7 @@ struct rule {
|
|||
};
|
||||
|
||||
extern struct rule **rules;
|
||||
extern int nrules;
|
||||
extern size_t nrules;
|
||||
extern int parse_errors;
|
||||
|
||||
struct passwd;
|
||||
|
|
6
parse.y
6
parse.y
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user