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.
This commit is contained in:
jspam 2024-05-22 19:56:25 +02:00 committed by Orestis Floros
parent 10397688c9
commit 200fef9e0d

View File

@ -92,7 +92,7 @@ void maybe_escape_markup(char *text, char *buffer, size_t size) {
size--; /* Leave a byte for NUL termination. */ size--; /* Leave a byte for NUL termination. */
if (markup_format == M_NONE) { if (markup_format == M_NONE) {
*buffer += snprintf(buffer, size, "%s", text); snprintf(buffer, size, "%s", text);
return; return;
} }