]> git.sesse.net Git - cubemap/blobdiff - log.cpp
Use nullptr instead of NULL everywhere.
[cubemap] / log.cpp
diff --git a/log.cpp b/log.cpp
index 417b544974d30754103bcb2640d0dce6c600f116..198ceae9f64633031397fe5117deddb2b013404e 100644 (file)
--- a/log.cpp
+++ b/log.cpp
@@ -16,7 +16,7 @@
 using namespace std;
 
 // Yes, it's a bit ugly.
-#define SYSLOG_FAKE_FILE (static_cast<FILE *>(NULL))
+#define SYSLOG_FAKE_FILE (static_cast<FILE *>(nullptr))
 
 bool logging_started = false;
 vector<FILE *> log_destinations;
@@ -24,7 +24,7 @@ vector<FILE *> log_destinations;
 void add_log_destination_file(const string &filename)
 {
        FILE *fp = fopen(filename.c_str(), "a");
-       if (fp == NULL) {
+       if (fp == nullptr) {
                perror(filename.c_str());
                return;
        }
@@ -71,11 +71,11 @@ void log(LogLevel log_level, const char *fmt, ...)
        vsnprintf(formatted_msg, sizeof(formatted_msg), fmt, ap);
        va_end(ap);
 
-       time_t now = time(NULL);
+       time_t now = time(nullptr);
        struct tm lt;
        struct tm *ltime = localtime_r(&now, &lt);
        char timestamp[1024];
-       if (ltime == NULL) {
+       if (ltime == nullptr) {
                strcpy(timestamp, "???");
        } else {
                strftime(timestamp, sizeof(timestamp), "%a, %d %b %Y %T %z", ltime);