Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libc/src/sys/time/linux/utimes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ LLVM_LIBC_FUNCTION(int, utimes,
#elif defined(SYS_utimensat)
// the utimensat syscall requires a timespec struct, not timeval.
struct timespec ts[2];
struct timespec *ts_ptr = nullptr; // default value if times is NULL
struct timespec *ts_ptr = nullptr; // default value if times is nullptr

// convert the microsec values in timeval struct times
// to nanosecond values in timespec struct ts
if (times != NULL) {
if (times != nullptr) {

// ensure consistent values
if ((times[0].tv_usec < 0 || times[1].tv_usec < 0) ||
Expand All @@ -54,7 +54,7 @@ LLVM_LIBC_FUNCTION(int, utimes,
ts_ptr = ts;
}

// If times was NULL, ts_ptr remains NULL, which utimensat interprets
// If times was nullptr, ts_ptr remains nullptr, which utimensat interprets
// as setting times to the current time.

// utimensat syscall.
Expand Down
8 changes: 4 additions & 4 deletions libc/test/src/time/ctime_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "test/UnitTest/Test.h"
#include "test/src/time/TmHelper.h"

TEST(LlvmLibcCtime, NULL) {
TEST(LlvmLibcCtime, nullptr) {
char *result;
result = LIBC_NAMESPACE::ctime(NULL);
ASSERT_STREQ(NULL, result);
result = LIBC_NAMESPACE::ctime(nullptr);
ASSERT_STREQ(nullptr, result);
}

TEST(LlvmLibcCtime, ValidUnixTimestamp0) {
Expand All @@ -38,5 +38,5 @@ TEST(LlvmLibcCtime, InvalidArgument) {
char *result;
t = 2147483648;
result = LIBC_NAMESPACE::ctime(&t);
ASSERT_STREQ(NULL, result);
ASSERT_STREQ(nullptr, result);
}
Loading