utils: split: fix substring length
@@ -239,8 +239,8 @@ struct mk_list *flb_utils_split(char *line, int separator, int max_split)
count++;
if (count >= max_split && max_split > 0) {
new = flb_malloc(sizeof(struct flb_split_entry));
- new->value = mk_string_copy_substr(line, i, end);
- new->len = end - i;
+ new->value = mk_string_copy_substr(line, i, len);
+ new->len = len - i;
mk_list_add(&new->_head, list);
break;
}
