From: Kevin Day Date: Mon, 24 Nov 2025 02:27:17 +0000 (-0600) Subject: Bugfix: The asctime_r() function appends a new line. X-Git-Tag: 0.8.0~84 X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=c4de23a920a42b635d347dbed33037b120a71304;p=fll Bugfix: The asctime_r() function appends a new line. Ensure that the new line is not counted as part of the date string. --- 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_