const char *val;
val = udev_device_get_sysattr_value(dev, key_name);
- if (val != NULL)
- util_strlcpy(value, val, sizeof(value));
+ if (val == NULL)
+ return -1;
+ util_strlcpy(value, val, sizeof(value));
}
- if (value[0] == '\0')
- return -1;
/* strip trailing whitespace of value, if not asked to match for it */
len = strlen(key_value);
continue;
case TK_A_LAST_RULE:
case TK_END:
- break;
+ return 0;
case TK_M_PARENTS_MAX:
case TK_M_MAX:
/* fast-forward to next rule */
idx = rule->rule.next_rule;
if (idx == 0)
- break;
+ return 0;
dbg(rules->udev, "forward to rule: %u\n", idx);
cur = &rules->tokens[idx];
}
- return 0;
}