diff options
Diffstat (limited to 'examples/c-influxd/c-influxd.c')
-rw-r--r-- | examples/c-influxd/c-influxd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/c-influxd/c-influxd.c b/examples/c-influxd/c-influxd.c index ed6f2e99e..c58c36ae3 100644 --- a/examples/c-influxd/c-influxd.c +++ b/examples/c-influxd/c-influxd.c @@ -946,6 +946,8 @@ static ssize_t influxd_map_index(char const * const json_key, struct global_map const * const map, size_t map_length) { + ssize_t unknown_key = -1; + if (json_key == NULL || key_length == 0) { return -1; @@ -955,6 +957,7 @@ static ssize_t influxd_map_index(char const * const json_key, { if (map[i].json_key == NULL) { + unknown_key = i; continue; } @@ -964,7 +967,7 @@ static ssize_t influxd_map_index(char const * const json_key, } } - return -1; + return unknown_key; } static int influxd_map_flow_u8(struct nDPIsrvd_socket * const sock, |