diff options
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r-- | lib/utils_base.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index a34cc5cc..77700f5b 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -258,7 +258,7 @@ int np_warn_if_not_root(void) { | |||
258 | * This function can be used to parse NTP control packet data and performance | 258 | * This function can be used to parse NTP control packet data and performance |
259 | * data strings. | 259 | * data strings. |
260 | */ | 260 | */ |
261 | char *np_extract_value(const char *varlist, const char *name) { | 261 | char *np_extract_value(const char *varlist, const char *name, char sep) { |
262 | char *tmp=NULL, *value=NULL; | 262 | char *tmp=NULL, *value=NULL; |
263 | int i; | 263 | int i; |
264 | 264 | ||
@@ -277,7 +277,7 @@ char *np_extract_value(const char *varlist, const char *name) { | |||
277 | /* strip leading spaces */ | 277 | /* strip leading spaces */ |
278 | for (varlist; isspace(varlist[0]); varlist++); | 278 | for (varlist; isspace(varlist[0]); varlist++); |
279 | 279 | ||
280 | if (tmp = index(varlist, ',')) { | 280 | if (tmp = index(varlist, sep)) { |
281 | /* Value is delimited by a comma */ | 281 | /* Value is delimited by a comma */ |
282 | if (tmp-varlist == 0) continue; | 282 | if (tmp-varlist == 0) continue; |
283 | value = (char *)malloc(tmp-varlist+1); | 283 | value = (char *)malloc(tmp-varlist+1); |
@@ -293,7 +293,7 @@ char *np_extract_value(const char *varlist, const char *name) { | |||
293 | break; | 293 | break; |
294 | } | 294 | } |
295 | } | 295 | } |
296 | if (tmp = index(varlist, ',')) { | 296 | if (tmp = index(varlist, sep)) { |
297 | /* More keys, keep going... */ | 297 | /* More keys, keep going... */ |
298 | varlist = tmp + 1; | 298 | varlist = tmp + 1; |
299 | } else { | 299 | } else { |