From 4d25593b4aa129be9194dfbc73165cd6da186902 Mon Sep 17 00:00:00 2001 From: Sascha Steinbiss Date: Fri, 1 Sep 2017 16:24:56 +0200 Subject: [PATCH] json: skip over double dots in output tokenizing Interface name shortening introduces double periods ('..') as spacers, which cause issues during JSON stats serialization as there '.' characters are also used as separators to define nesting of the JSON output. This commit makes sure that '..' are skipped during tokenizing. Fixes Redmine bug #2208. --- src/output-json-stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/output-json-stats.c b/src/output-json-stats.c index 436d621ac4..0b99948b36 100644 --- a/src/output-json-stats.c +++ b/src/output-json-stats.c @@ -68,6 +68,8 @@ static json_t *OutputStats2Json(json_t *js, const char *key) const char *dot = index(key, '.'); if (dot == NULL) return NULL; + if (*(dot + 1) == '.' && *(dot + 2) != '\0') + dot = index(dot + 2, '.'); size_t predot_len = (dot - key) + 1; char s[predot_len]; -- 2.47.2