From 481744a2ba4d9b795918d3bc0767321e05e10bbd Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 16 Sep 2018 01:12:06 +0200 Subject: Move splitkv function to libcfg Signed-off-by: David Oberhollenzer --- lib/util/rdsvc.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'lib/util/rdsvc.c') diff --git a/lib/util/rdsvc.c b/lib/util/rdsvc.c index 37c7ba0..3e146a2 100644 --- a/lib/util/rdsvc.c +++ b/lib/util/rdsvc.c @@ -226,33 +226,6 @@ static const struct svc_param { { "after", 0, RDSVC_NO_DEPS, svc_after }, }; -static int splitkv(rdline_t *rd, char **k, char **v) -{ - char *key = rd->buffer, *value = rd->buffer; - - while (*value != ' ' && *value != '\0') { - if (!isalpha(*value)) { - fprintf(stderr, - "%s: %zu: unexpected '%c' in keyword\n", - rd->filename, rd->lineno, *value); - return -1; - } - ++value; - } - - if (*value != ' ') { - fprintf(stderr, "%s: %zu: expected argument after '%s'\n", - rd->filename, rd->lineno, key); - return -1; - } - - *(value++) = '\0'; - - *k = key; - *v = value; - return 0; -} - static const struct svc_param *find_param(rdline_t *rd, const char *name) { size_t i; -- cgit v1.2.3