From c4de23a920a42b635d347dbed33037b120a71304 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 23 Nov 2025 20:27:17 -0600 Subject: [PATCH] Bugfix: The asctime_r() function appends a new line. Ensure that the new line is not counted as part of the date string. --- level_0/f_time/c/time.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/level_0/f_time/c/time.c b/level_0/f_time/c/time.c index c061d9f..6f67b57 100644 --- a/level_0/f_time/c/time.c +++ b/level_0/f_time/c/time.c @@ -42,6 +42,11 @@ extern "C" { const f_status_t status = f_string_append(string, strnlen(string, F_time_calendar_string_length_d), destination); if (F_status_is_error(status)) return status; + // Ensure that if a new line is added by asctime_r(), it is removed. + if (destination->used && destination->string[destination->used - 1] == f_string_ascii_feed_line_s.string[0]) { + --destination->used; + } + return F_okay; } #endif // _di_f_time_calendar_string_part_ -- 1.8.3.1