diff options
author | 3gg <3gg@shellblade.net> | 2025-06-30 15:29:44 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-06-30 15:29:44 -0700 |
commit | 25a367862dbdfb0fdfdfc6f619af3f0a7e0fe79f (patch) | |
tree | 60269cf9a704c059495f52c3ad5a23794b2698c3 /filesystem/src | |
parent | 9b3ba8c80360c09dd32ee9645c536161b5dd0cff (diff) |
Use nullptr
Diffstat (limited to 'filesystem/src')
-rw-r--r-- | filesystem/src/filesystem.c | 6 | ||||
-rw-r--r-- | filesystem/src/path.c | 2 |
2 files changed, 4 insertions, 4 deletions
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) { | |||
27 | void* read_file(const char* filepath) { | 27 | void* read_file(const char* filepath) { |
28 | assert(filepath); | 28 | assert(filepath); |
29 | 29 | ||
30 | void* data = 0; | 30 | void* data = nullptr; |
31 | 31 | ||
32 | FILE* file = fopen(filepath, "rb"); | 32 | FILE* file = fopen(filepath, "rb"); |
33 | if (!file) { | 33 | if (!file) { |
34 | return 0; | 34 | return nullptr; |
35 | } | 35 | } |
36 | const size_t file_size = get_file_size(file); | 36 | const size_t file_size = get_file_size(file); |
37 | if (file_size == (size_t)-1) { | 37 | if (file_size == (size_t)-1) { |
@@ -53,5 +53,5 @@ cleanup: | |||
53 | if (data) { | 53 | if (data) { |
54 | free(data); | 54 | free(data); |
55 | } | 55 | } |
56 | return 0; | 56 | return nullptr; |
57 | } | 57 | } |
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) { | |||
21 | void path_del(path* path) { | 21 | void path_del(path* path) { |
22 | if (path) { | 22 | if (path) { |
23 | free(path->data); | 23 | free(path->data); |
24 | path->data = 0; | 24 | path->data = nullptr; |
25 | path->size = 0; | 25 | path->size = 0; |
26 | } | 26 | } |
27 | } | 27 | } |