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.
pull/2941/head
Sascha Steinbiss 8 years ago committed by Victor Julien
parent d9e5dfa1f0
commit 4d25593b4a

@ -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];

Loading…
Cancel
Save