We have `buflen` available. We can remove `strncat` and assign the characters
directly, without traversing the whole buffer.
Fixes a compiler warning:
logd_output_JSON.c:407:9: warning: `strncat` specified bound 1 equals source length
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
return ULOGD_IRET_ERR;
}
buf = tmp;
- strncat(buf, "\n", 1);
- buflen++;
+ buf[buflen++] = '\n';
+ buf[buflen] = '\0';
if (opi->mode == JSON_MODE_FILE)
return json_interp_file(upi, buf);