Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.
Test: m
Bug: 68236239
Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
diff --git a/libc/bionic/syslog.cpp b/libc/bionic/syslog.cpp
index 9424573..d1a0c5b 100644
--- a/libc/bionic/syslog.cpp
+++ b/libc/bionic/syslog.cpp
@@ -21,11 +21,11 @@
#include <async_safe/log.h>
-static const char* syslog_log_tag = NULL;
+static const char* syslog_log_tag = nullptr;
static int syslog_priority_mask = 0xff;
void closelog() {
- syslog_log_tag = NULL;
+ syslog_log_tag = nullptr;
}
void openlog(const char* log_tag, int /*options*/, int /*facility*/) {
@@ -58,7 +58,7 @@
// What's our log tag?
const char* log_tag = syslog_log_tag;
- if (log_tag == NULL) {
+ if (log_tag == nullptr) {
log_tag = getprogname();
}
@@ -78,7 +78,7 @@
// glibc's printf family support %m directly, but our BSD-based one doesn't.
// If the format string seems to contain "%m", rewrite it.
const char* log_fmt = fmt;
- if (strstr(fmt, "%m") != NULL) {
+ if (strstr(fmt, "%m") != nullptr) {
size_t dst_len = 1024;
char* dst = reinterpret_cast<char*>(malloc(dst_len));
log_fmt = dst;