diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-09-05 13:32:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 13:32:58 +0200 |
commit | 7b1b271f43e9ceca3b195e7e3d56147d38919c2b (patch) | |
tree | ed2d0c84ed966a55bd0b1bfadfb0b8fedb434e14 /src/tree_sitter/alloc.h | |
parent | 3853276d9cacc99a2698117e904475dbf7033383 (diff) | |
parent | b33e375b2b4e6c9232cdbfd5d6b7cb1b15e0f525 (diff) | |
download | rneovim-7b1b271f43e9ceca3b195e7e3d56147d38919c2b.tar.gz rneovim-7b1b271f43e9ceca3b195e7e3d56147d38919c2b.tar.bz2 rneovim-7b1b271f43e9ceca3b195e7e3d56147d38919c2b.zip |
Merge pull request #12788 from bfredl/nulloffset-1
robustness: avoid adding offset to NULL pointer
Diffstat (limited to 'src/tree_sitter/alloc.h')
-rw-r--r-- | src/tree_sitter/alloc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tree_sitter/alloc.h b/src/tree_sitter/alloc.h index d3c6b5eca8..32c90f23c8 100644 --- a/src/tree_sitter/alloc.h +++ b/src/tree_sitter/alloc.h @@ -58,7 +58,7 @@ static inline bool ts_toggle_allocation_recording(bool value) { static inline void *ts_malloc(size_t size) { void *result = malloc(size); if (size > 0 && !result) { - fprintf(stderr, "tree-sitter failed to allocate %lu bytes", size); + fprintf(stderr, "tree-sitter failed to allocate %zu bytes", size); exit(1); } return result; @@ -67,7 +67,7 @@ static inline void *ts_malloc(size_t size) { static inline void *ts_calloc(size_t count, size_t size) { void *result = calloc(count, size); if (count > 0 && !result) { - fprintf(stderr, "tree-sitter failed to allocate %lu bytes", count * size); + fprintf(stderr, "tree-sitter failed to allocate %zu bytes", count * size); exit(1); } return result; @@ -76,7 +76,7 @@ static inline void *ts_calloc(size_t count, size_t size) { static inline void *ts_realloc(void *buffer, size_t size) { void *result = realloc(buffer, size); if (size > 0 && !result) { - fprintf(stderr, "tree-sitter failed to reallocate %lu bytes", size); + fprintf(stderr, "tree-sitter failed to reallocate %zu bytes", size); exit(1); } return result; |