diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/al/array_typed.h | 2 | ||||
| -rw-r--r-- | include/al/str.h | 2 | ||||
| -rw-r--r-- | include/al/wstr.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/al/array_typed.h b/include/al/array_typed.h index e4a6c53..73e77f7 100644 --- a/include/al/array_typed.h +++ b/include/al/array_typed.h @@ -88,7 +88,7 @@ } \ static inline void al_array_free(N, __VA_ARGS__)(array(N, __VA_ARGS__) *array) \ { \ - if (array->data != NULL) al_free(array->data); \ + if (array->data) al_free(array->data); \ } #define AL_ARRAY_DEFINE(N, T) \ diff --git a/include/al/str.h b/include/al/str.h index 93b4f4a..ac5dba8 100644 --- a/include/al/str.h +++ b/include/al/str.h @@ -34,7 +34,7 @@ static inline bool al_str_is_empty(str *s) static inline void al_str_free(str *s) { - if (s->alloc > 0) al_free(s->data); + if (s->alloc) al_free(s->data); } static inline u32 al_str_reserve(str *s, u32 size) diff --git a/include/al/wstr.h b/include/al/wstr.h index c80eac2..af66161 100644 --- a/include/al/wstr.h +++ b/include/al/wstr.h @@ -44,7 +44,7 @@ static inline bool al_wstr_is_empty(wstr *w) static inline void al_wstr_free(wstr *w) { - if (w->alloc > 0) al_free(w->data); + if (w->alloc) al_free(w->data); } static inline u32 al_wstr_reserve(wstr *w, u32 size) |