diff options
Diffstat (limited to 'libc/src/time/strftime_l.cpp')
| -rw-r--r-- | libc/src/time/strftime_l.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/src/time/strftime_l.cpp b/libc/src/time/strftime_l.cpp index 409f868..2ec9063 100644 --- a/libc/src/time/strftime_l.cpp +++ b/libc/src/time/strftime_l.cpp @@ -26,10 +26,10 @@ LLVM_LIBC_FUNCTION(size_t, strftime_l, printf_core::WriteMode::FILL_BUFF_AND_DROP_OVERFLOW>::value> wb(buffer, (buffsz > 0 ? buffsz - 1 : 0)); printf_core::Writer writer(wb); - int ret = strftime_core::strftime_main(&writer, format, timeptr); + auto ret = strftime_core::strftime_main(&writer, format, timeptr); if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer. wb.buff[wb.buff_cur] = '\0'; - return (ret < 0 || static_cast<size_t>(ret) >= buffsz) ? 0 : ret; + return (!ret.has_value() || ret.value() >= buffsz) ? 0 : ret.value(); } } // namespace LIBC_NAMESPACE_DECL |
