diff options
author | Tom Gundersen <teg@jklm.no> | 2014-11-28 21:44:31 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-11-28 21:54:24 +0100 |
commit | 84198c1892cce2cb27d22bfa816da5d43c05add0 (patch) | |
tree | f2134a95637eb26bf13754e9ab63c4107466ae2d /src | |
parent | 22d097a6bbeac0d45c42e1b246403a97e9a16c30 (diff) |
udev: rules - modernise add_rule a bit
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udev-rules.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index ff2d4ec850..a261fbf978 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1042,11 +1042,11 @@ static int add_rule(struct udev_rules *rules, char *line, const char *filename, unsigned int filename_off, unsigned int lineno) { char *linepos; const char *attr; - struct rule_tmp rule_tmp; + struct rule_tmp rule_tmp = { + .rules = rules, + .rule.type = TK_RULE, + }; - memzero(&rule_tmp, sizeof(struct rule_tmp)); - rule_tmp.rules = rules; - rule_tmp.rule.type = TK_RULE; /* the offset in the rule is limited to unsigned short */ if (filename_off < USHRT_MAX) rule_tmp.rule.rule.filename_off = filename_off; |