Merge "Nullability check for utmp module"
diff --git a/libc/include/utmp.h b/libc/include/utmp.h
index cb72ce2..7aa5718 100644
--- a/libc/include/utmp.h
+++ b/libc/include/utmp.h
@@ -99,7 +99,7 @@
/**
* Does nothing.
*/
-int utmpname(const char* __path);
+int utmpname(const char* _Nonnull __path);
/**
* Does nothing.
*/
@@ -107,11 +107,11 @@
/**
* Does nothing.
*/
-struct utmp* getutent(void);
+struct utmp* _Nullable getutent(void);
/**
* Does nothing.
*/
-struct utmp* pututline(const struct utmp* __entry);
+struct utmp* _Nullable pututline(const struct utmp* _Nonnull __entry);
/**
* Does nothing.
*/
diff --git a/tests/utmp_test.cpp b/tests/utmp_test.cpp
index 6d0d6f1..b024818 100644
--- a/tests/utmp_test.cpp
+++ b/tests/utmp_test.cpp
@@ -29,5 +29,6 @@
setutent();
ASSERT_EQ(NULL, getutent());
endutent();
- ASSERT_EQ(NULL, pututline(NULL));
+ utmp failure = {.ut_type = EMPTY};
+ ASSERT_EQ(NULL, pututline(&failure));
}