diff options
author | Greg KH <gregkh@linuxfoundation.org> | 2014-02-02 07:15:23 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-02-02 07:15:23 -0500 |
commit | 8fe035158681d0324ff2be99a67bc0434da6faad (patch) | |
tree | c9a82a131e2597a62ed392355e39dfc7a888da9d /src/udev/udev-rules.c | |
parent | 7eefa0ad0db267d99448fcddff2aebb4ebc33f6f (diff) |
use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set). So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r-- | src/udev/udev-rules.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index d129b0f3a0..e5a15aa934 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -875,7 +875,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, struct token *token = &rule_tmp->token[rule_tmp->token_cur]; const char *attr = NULL; - memset(token, 0x00, sizeof(struct token)); + memzero(token, sizeof(struct token)); switch (type) { case TK_M_ACTION: @@ -1057,7 +1057,7 @@ static int add_rule(struct udev_rules *rules, char *line, const char *attr; struct rule_tmp rule_tmp; - memset(&rule_tmp, 0x00, sizeof(struct rule_tmp)); + 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 */ @@ -1657,7 +1657,7 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) strv_free(files); - memset(&end_token, 0x00, sizeof(struct token)); + memzero(&end_token, sizeof(struct token)); end_token.type = TK_END; add_token(rules, &end_token); log_debug("rules contain %zu bytes tokens (%u * %zu bytes), %zu bytes strings", |