Skip to content

Commit

Permalink
maybe_escape_markup: Don't mangle output if markup is disabled
Browse files Browse the repository at this point in the history
As it is, the code modifies the first char of `buffer`, increasing it
by the number of bytes written.
  • Loading branch information
jspam authored and orestisfl committed May 22, 2024
1 parent 1039768 commit 200fef9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 200fef9

Please sign in to comment.