Commit 59f83976 authored by Tatsuhiko Kubo's avatar Tatsuhiko Kubo

Use nullptr instead of NULL in C++.

parent 061732ad
...@@ -737,15 +737,15 @@ char *get_exec_path(int argc, char **const argv, const char *cwd) { ...@@ -737,15 +737,15 @@ char *get_exec_path(int argc, char **const argv, const char *cwd) {
if (argv0[0] == '/') { if (argv0[0] == '/') {
path = static_cast<char *>(malloc(len + 1)); path = static_cast<char *>(malloc(len + 1));
if (path == NULL) { if (path == nullptr) {
return NULL; return nullptr;
} }
memcpy(path, argv0, len + 1); memcpy(path, argv0, len + 1);
} else { } else {
auto cwdlen = strlen(cwd); auto cwdlen = strlen(cwd);
path = static_cast<char *>(malloc(len + 1 + cwdlen + 1)); path = static_cast<char *>(malloc(len + 1 + cwdlen + 1));
if (path == NULL) { if (path == nullptr) {
return NULL; return nullptr;
} }
memcpy(path, cwd, cwdlen); memcpy(path, cwd, cwdlen);
path[cwdlen] = '/'; path[cwdlen] = '/';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment