udev-rules: use structured initializer
This commit is contained in:
parent
92b80c6baa
commit
1017d66bf5
|
@ -1518,10 +1518,13 @@ struct udev_rules *udev_rules_new(int resolve_names) {
|
||||||
char **files, **f;
|
char **files, **f;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
rules = new0(struct udev_rules, 1);
|
rules = new(struct udev_rules, 1);
|
||||||
if (rules == NULL)
|
if (!rules)
|
||||||
return NULL;
|
return NULL;
|
||||||
rules->resolve_names = resolve_names;
|
|
||||||
|
*rules = (struct udev_rules) {
|
||||||
|
.resolve_names = resolve_names,
|
||||||
|
};
|
||||||
|
|
||||||
/* init token array and string buffer */
|
/* init token array and string buffer */
|
||||||
rules->tokens = malloc_multiply(PREALLOC_TOKEN, sizeof(struct token));
|
rules->tokens = malloc_multiply(PREALLOC_TOKEN, sizeof(struct token));
|
||||||
|
|
Loading…
Reference in a new issue