gout

A static git page generator
git clone https://git.bracken.jp/gout.git
Log | Files | Refs | README | LICENSE

commit 32a587d492299ddf147a7a70e130cbebe6f20659
parent a693bab2ba425ca3f055b6eac10f18fcba901d0a
Author: Chris Bracken <chris@bracken.jp>
Date:   Wed, 18 Feb 2026 09:57:46 +0900

format: add TODO to inject tz offset to print_time_short

This is currently inconsistent with other functions and always uses GMT.
Also adds curly brackets that were missing.

Diffstat:
Msrc/format.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/format.c b/src/format.c @@ -49,6 +49,7 @@ void print_time_z(FILE* out, time_t time) { fprintf(out, "%s", formatted_time); } +/* TODO: add timezone_offset to print_time_short. */ void print_time_short(FILE* out, time_t time) { struct tm* time_in = gmtime(&time); if (!time_in) { @@ -162,8 +163,9 @@ void print_gopher_link_padded(FILE* out, const char* str, size_t width, char pad_char) { - if (width == 0) + if (width == 0) { return; + } size_t display_width = 0; size_t last_char_width = 0; @@ -177,8 +179,9 @@ void print_gopher_link_padded(FILE* out, while (ptr < end) { wchar_t wc; size_t bytes = mbrtowc(&wc, ptr, end - ptr, &state); - if (bytes == 0) + if (bytes == 0) { break; + } if (bytes == (size_t)-1 || bytes == (size_t)-2) { // Invalid (-1) or incomplete (-2) UTF-8. Consume 1 byte.