From 432870c5afd45ef0b96214379f12438062d81d5d Mon Sep 17 00:00:00 2001 From: jspam Date: Wed, 22 May 2024 19:56:25 +0200 Subject: [PATCH] maybe_escape_markup: Don't mangle output if markup is disabled As it is, the code modifies the first char of `buffer`, increasing it by the number of bytes written. --- src/output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.c b/src/output.c index e1bfa1fa..dadad729 100644 --- a/src/output.c +++ b/src/output.c @@ -92,7 +92,7 @@ void maybe_escape_markup(char *text, char *buffer, size_t size) { size--; /* Leave a byte for NUL termination. */ if (markup_format == M_NONE) { - *buffer += snprintf(buffer, size, "%s", text); + snprintf(buffer, size, "%s", text); return; }