File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 88
99#include " src/time/localtime.h"
1010#include " src/time/time_utils.h"
11+ #include " src/__support/macros/null_check.h"
1112
1213namespace LIBC_NAMESPACE_DECL {
1314
1415LLVM_LIBC_FUNCTION (struct tm *, localtime, (const time_t *timer)) {
15- static struct tm tm_out;
16-
17- if (timer == nullptr ) {
18- return nullptr ;
19- }
16+ LIBC_CRASH_ON_NULLPTR (timer);
2017
18+ static struct tm tm_out;
2119 return time_utils::localtime_internal (timer, &tm_out);
2220}
2321
Original file line number Diff line number Diff line change 88
99#include " src/time/localtime_r.h"
1010#include " src/time/time_utils.h"
11+ #include " src/__support/macros/null_check.h"
1112
1213namespace LIBC_NAMESPACE_DECL {
1314
1415LLVM_LIBC_FUNCTION (struct tm *, localtime_r,
1516 (const time_t *timer, struct tm *buf)) {
16- if (timer == nullptr ) {
17- return nullptr ;
18- }
17+ LIBC_CRASH_ON_NULLPTR (timer);
1918
2019 return time_utils::localtime_internal (timer, buf);
2120}
You can’t perform that action at this time.
0 commit comments