print_file_contents: fix colors

Commit
f0b5758c72
broke the END_COLOR macro because the outwalk variable was not updated.
This commit is contained in:
Michael Stapelberg 2021-11-01 09:41:17 +01:00
parent 6102cdc0b7
commit 8598a76681
1 changed files with 4 additions and 3 deletions

View File

@ -59,11 +59,12 @@ void print_file_contents(yajl_gen json_gen, char *buffer, const char *title, con
{.name = "%error", .value = strerror(errno)}};
const size_t num = sizeof(placeholders) / sizeof(placeholder_t);
buffer = format_placeholders(walk, &placeholders[0], num);
char *formatted = format_placeholders(walk, &placeholders[0], num);
strcpy(outwalk, formatted);
outwalk += strlen(formatted);
free(formatted);
free(buf);
END_COLOR;
OUTPUT_FULL_TEXT(buffer);
free(buffer);
}