From 7e6f12dfba76b295d40e835d310d69d625ede88e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 19 Dec 2011 15:17:39 +0100 Subject: [PATCH] src/common.c: parse_value: Be more verbose about parsing problems. Change-Id: I784ec4ee9a1e89a82fdc9da54ed1fafd3d9c3e57 --- src/common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common.c b/src/common.c index c3e502ad..d2a1b362 100644 --- a/src/common.c +++ b/src/common.c @@ -876,12 +876,15 @@ int parse_value (const char *value, value_t *ret_value, int ds_type) } if (value == endptr) { - ERROR ("parse_value: Failed to parse string as number: %s.", value); + ERROR ("parse_value: Failed to parse string as %s: %s.", + DS_TYPE_TO_STRING (ds_type), value); return -1; } else if ((NULL != endptr) && ('\0' != *endptr)) - WARNING ("parse_value: Ignoring trailing garbage after number: %s.", - endptr); + INFO ("parse_value: Ignoring trailing garbage \"%s\" after %s value. " + "Input string was \"%s\".", + endptr, DS_TYPE_TO_STRING (ds_type), value); + return 0; } /* int parse_value */ -- 2.11.0