chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-dhcp-lease: use shared default prefixlen function
[elogind.git]
/
src
/
shared
/
conf-parser.c
diff --git
a/src/shared/conf-parser.c
b/src/shared/conf-parser.c
index 0be7226871218e0a38f687ad59d6a55ca6fc9dc2..ee6de653e13286220202f067485e2e70cdbeea1c 100644
(file)
--- a/
src/shared/conf-parser.c
+++ b/
src/shared/conf-parser.c
@@
-675,7
+675,8
@@
int config_parse_strv(const char *unit,
void *data,
void *userdata) {
void *data,
void *userdata) {
- char *** sv = data, *w, *state;
+ char ***sv = data;
+ const char *word, *state;
size_t l;
int r;
size_t l;
int r;
@@
-700,15
+701,16
@@
int config_parse_strv(const char *unit,
return 0;
}
return 0;
}
- FOREACH_WORD_QUOTED(w, l, rvalue, state) {
+ FOREACH_WORD_QUOTED(w
ord
, l, rvalue, state) {
char *n;
char *n;
- n = strndup(w, l);
+ n = strndup(w
ord
, l);
if (!n)
return log_oom();
if (!utf8_is_valid(n)) {
log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
if (!n)
return log_oom();
if (!utf8_is_valid(n)) {
log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
+ free(n);
continue;
}
continue;
}
@@
-716,6
+718,9
@@
int config_parse_strv(const char *unit,
if (r < 0)
return log_oom();
}
if (r < 0)
return log_oom();
}
+ if (!isempty(state))
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+ "Trailing garbage, ignoring.");
return 0;
}
return 0;
}