summaryrefslogtreecommitdiff
path: root/nDPId.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-08-03 21:42:58 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-08-03 21:42:58 +0200
commitf99ddb5bce618bf469961c1235de402dc4bba703 (patch)
tree9cc5b3badb25901324e2b20a978818d264eb9b00 /nDPId.c
parent89dd7a21788b6c4bfb540c99aa1982a3526d5c12 (diff)
prefix every generated json string with the length of itself in bytes
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPId.c')
-rw-r--r--nDPId.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nDPId.c b/nDPId.c
index e3a886132..be69b55e8 100644
--- a/nDPId.c
+++ b/nDPId.c
@@ -680,7 +680,8 @@ static void send_to_json_sink(struct nDPId_reader_thread * const reader_thread,
int s_ret;
char newline_json_str[BUFSIZ];
- s_ret = snprintf(newline_json_str, sizeof(newline_json_str), "%.*s\n", (int)json_str_len, json_str);
+ s_ret = snprintf(newline_json_str, sizeof(newline_json_str), "%zu%.*s\n",
+ json_str_len, (int)json_str_len, json_str);
if (s_ret < 0 || s_ret > (int)sizeof(newline_json_str))
{
syslog(LOG_DAEMON | LOG_ERR,