Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udev-rules: Fix compile errors with -DDEBUG=1 #288

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/udev/udev-rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ static void dump_token(struct udev_rules *rules, struct token *token) {
enum token_type type = token->type;
enum operation_type op = token->key.op;
enum string_glob_type glob = token->key.glob;
const char *value = str(rules, token->key.value_off);
const char *attr = &rules->buf[token->key.attr_off];
const char *value = rules_str(rules, token->key.value_off);
const char *attr = rules_str(rules, token->key.attr_off);

switch (type) {
case TK_RULE:
Expand All @@ -337,9 +337,9 @@ static void dump_token(struct udev_rules *rules, struct token *token) {
unsigned int idx = (tk_ptr - tks_ptr) / sizeof(struct token);

log_debug("* RULE %s:%u, token: %u, count: %u, label: '%s'",
&rules->buf[token->rule.filename_off], token->rule.filename_line,
rules_str(rules, token->rule.filename_off), token->rule.filename_line,
idx, token->rule.token_count,
&rules->buf[token->rule.label_off]);
rules_str(rules, token->rule.label_off));
break;
}
case TK_M_ACTION:
Expand Down Expand Up @@ -436,11 +436,11 @@ static void dump_token(struct udev_rules *rules, struct token *token) {
static void dump_rules(struct udev_rules *rules) {
unsigned int i;

log_debug("dumping %u (%zu bytes) tokens, %u (%zu bytes) strings",
log_debug("dumping %u tokens (%zu bytes), %zu strings (%zu bytes)",
rules->token_cur,
rules->token_cur * sizeof(struct token),
rules->buf_count,
rules->buf_cur);
rules->strbuf->in_count,
rules->strbuf->in_len);
for (i = 0; i < rules->token_cur; i++)
dump_token(rules, &rules->tokens[i]);
}
Expand Down
Loading