From 25a367862dbdfb0fdfdfc6f619af3f0a7e0fe79f Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 30 Jun 2025 15:29:44 -0700 Subject: Use nullptr --- filesystem/src/filesystem.c | 6 +++--- filesystem/src/path.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'filesystem') diff --git a/filesystem/src/filesystem.c b/filesystem/src/filesystem.c index b228e85..b0c207a 100644 --- a/filesystem/src/filesystem.c +++ b/filesystem/src/filesystem.c @@ -27,11 +27,11 @@ size_t get_file_size(FILE* file) { void* read_file(const char* filepath) { assert(filepath); - void* data = 0; + void* data = nullptr; FILE* file = fopen(filepath, "rb"); if (!file) { - return 0; + return nullptr; } const size_t file_size = get_file_size(file); if (file_size == (size_t)-1) { @@ -53,5 +53,5 @@ cleanup: if (data) { free(data); } - return 0; + return nullptr; } diff --git a/filesystem/src/path.c b/filesystem/src/path.c index 2ce5a04..544a5d1 100644 --- a/filesystem/src/path.c +++ b/filesystem/src/path.c @@ -21,7 +21,7 @@ path path_new(const char* str) { void path_del(path* path) { if (path) { free(path->data); - path->data = 0; + path->data = nullptr; path->size = 0; } } -- cgit v1.2.3