status = MATCHER_INCOMPLETE;
// cleanup
- list_delete_and_null(&next);
+ list_delete(&next);
return status;
}
unsigned int idx;
for (idx = 0; idx < vector_active(vline) && next->count > 0; idx++) {
- list_delete_and_null(¤t);
+ list_delete(¤t);
current = next;
next = list_new();
next->del = stack_del;
}
}
- list_delete_and_null(¤t);
- list_delete_and_null(&next);
+ list_delete(¤t);
+ list_delete(&next);
return mrv;
}
list_delete_node(list, tail);
// delete the rest of the list as usual
- list_delete_and_null(&list);
+ list_delete(&list);
}
/*---------- token level matching functions ----------*/
dots++;
break;
}
- if (!isdigit((int)*str))
+ if (!isdigit((unsigned char)*str))
return no_match;
str++;
if (str - sp > 3)
return no_match;
- strncpy(buf, sp, str - sp);
- if (atoi(buf) > 255)
+ memcpy(buf, sp, str - sp);
+
+ int v = atoi(buf);
+
+ if (v > 255)
+ return no_match;
+ if (v > 0 && buf[0] == '0')
return no_match;
nums++;
break;
}
- if (!isdigit((int)*str))
+ if (!isdigit((unsigned char)*str))
return no_match;
str++;
if (str - sp > 3)
return no_match;
- strncpy(buf, sp, str - sp);
- if (atoi(buf) > 255)
+ memcpy(buf, sp, str - sp);
+
+ int v = atoi(buf);
+
+ if (v > 255)
+ return no_match;
+ if (v > 0 && buf[0] == '0')
return no_match;
if (dots == 3) {
sp = str;
while (*str != '\0') {
- if (!isdigit((int)*str))
+ if (!isdigit((unsigned char)*str))
return no_match;
str++;