From d7aec10317eb21e871b94f975879999c8a990a3b Mon Sep 17 00:00:00 2001 From: eriedaberrie Date: Sat, 1 Feb 2025 03:39:10 +0000 Subject: [PATCH] Use nullptr instead of NULL --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c30c786..4c7cb84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) { char *res_loc; switch (argc - optind) { case 0: { - res_loc = NULL; + res_loc = nullptr; for (const auto& fe : std::filesystem::directory_iterator(".")) { if (!fe.is_regular_file()) continue; @@ -72,9 +72,9 @@ int main(int argc, char *argv[]) { if (fp.extension() != ".shp") continue; - if (res_loc != NULL) { + if (res_loc != nullptr) { free(res_loc); - res_loc = NULL; + res_loc = nullptr; break; } @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) { fps.copy(res_loc, fps.size()); res_loc[fps.size()] = '\0'; } - if (res_loc == NULL) { + if (res_loc == nullptr) { std::cerr << "Failed to automatically find residents shapefile!" << std::endl; return 1; }