summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-11-28 21:44:31 +0100
committerAnthony G. Basile <blueness@gentoo.org>2014-12-01 19:42:39 -0500
commit5cb98078479d93e25099c1cb73fa9c46aa9ccf29 (patch)
treeaf13868380b7ab16a5171ed18ec85785b2524090
parented19623f625ae5b1727c0e80a74e3d4da64af00a (diff)
udev: rules - modernise add_rule a bit
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/udev/udev-rules.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index ddbde5a784..107c20bb51 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1047,11 +1047,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;