Skip to content

Commit 60af835

Browse files
[libc] Fix implicit cast warning in strftime (#127282)
Forgot to change a size_t to an int, which caused warnings on gcc but not clang for some reason. Regardless, this patch fixes the issue.
1 parent 398f865 commit 60af835

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/time/strftime_core/composite_converter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ LIBC_INLINE int convert_full_date_time(printf_core::Writer *writer,
171171
// we only pad the first conversion, and we assume all the other values are in
172172
// their valid ranges.
173173
// sizeof("Sun Jan 12 03:45:06 2025")
174-
const size_t full_conv_len = 3 + 1 + 3 + 1 + 2 + 1 + 8 + 1 + 4;
174+
constexpr int FULL_CONV_LEN = 3 + 1 + 3 + 1 + 2 + 1 + 8 + 1 + 4;
175175
// use the full conv len because this isn't being passed to a proper converter
176176
// that will handle the width of the leading conversion. Instead it has to be
177177
// handled below.
178-
const int requested_padding = to_conv.min_width - full_conv_len;
178+
const int requested_padding = to_conv.min_width - FULL_CONV_LEN;
179179

180180
cpp::string_view wday_str = unwrap_opt(time_reader.get_weekday_short_name());
181181
cpp::string_view month_str = unwrap_opt(time_reader.get_month_short_name());

0 commit comments

Comments
 (0)