From f0ad185421c02f900fa4dd0f32ebbfba20d947b5 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Sat, 2 Apr 2022 08:23:55 -0700 Subject: [PATCH] Fix formatted responses to include the trailing NUL --- daemon/x52d_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/x52d_command.c b/daemon/x52d_command.c index d372cb2..fe81c2d 100644 --- a/daemon/x52d_command.c +++ b/daemon/x52d_command.c @@ -143,7 +143,7 @@ static void response_formatted(char *buffer, int *buflen, const char *type, if (*fmt) { va_start(ap, fmt); - resplen += vsnprintf(response + typelen, sizeof(response) - typelen, fmt, ap); + resplen += vsnprintf(response + typelen, sizeof(response) - typelen, fmt, ap) + 1; va_end(ap); }