void *data,
void *userdata) {
- char *** sv = data, *w, *state;
+ char ***sv = data;
+ const char *word, *state;
size_t l;
int r;
return 0;
}
- FOREACH_WORD_QUOTED(w, l, rvalue, state) {
+ FOREACH_WORD_QUOTED(word, l, rvalue, state) {
char *n;
- n = strndup(w, l);
+ n = strndup(word, l);
if (!n)
return log_oom();
if (!utf8_is_valid(n)) {
log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
+ free(n);
continue;
}
if (r < 0)
return log_oom();
}
+ if (!isempty(state))
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+ "Trailing garbage, ignoring.");
return 0;
}