aboutsummaryrefslogtreecommitdiff
path: root/libc/src/time/strftime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/time/strftime.cpp')
-rw-r--r--libc/src/time/strftime.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/src/time/strftime.cpp b/libc/src/time/strftime.cpp
index 89b7d9b..ff8c05a 100644
--- a/libc/src/time/strftime.cpp
+++ b/libc/src/time/strftime.cpp
@@ -23,10 +23,10 @@ LLVM_LIBC_FUNCTION(size_t, strftime,
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