unsigned int i;
int ret = 0;
char *str;
+ int len;
for (i = 0; i < hist_data->attrs->n_actions; i++) {
str = hist_data->attrs->action_str[i];
- if (str_has_prefix(str, "onmatch(")) {
- char *action_str = str + sizeof("onmatch(") - 1;
+ if ((len = str_has_prefix(str, "onmatch("))) {
+ char *action_str = str + len;
data = onmatch_parse(tr, action_str);
if (IS_ERR(data)) {
break;
}
data->fn = action_trace;
- } else if (str_has_prefix(str, "onmax(")) {
- char *action_str = str + sizeof("onmax(") - 1;
+ } else if ((len = str_has_prefix(str, "onmax("))) {
+ char *action_str = str + len;
data = onmax_parse(action_str);
if (IS_ERR(data)) {