diff options
| author | 2017-02-07 20:13:56 +0000 | |
|---|---|---|
| committer | 2017-02-07 20:13:56 +0000 | |
| commit | fd88428545cac94db72e93a1ff36c27153628874 (patch) | |
| tree | 508410e772974b8868bb97e98bd05ccea752e8a1 /gb_string.h | |
| parent | Merge branch 'master' of https://github.com/gingerBill/gb (diff) | |
Fix issue #21
Diffstat (limited to 'gb_string.h')
| -rw-r--r-- | gb_string.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gb_string.h b/gb_string.h index 32ef68a..a0058a5 100644 --- a/gb_string.h +++ b/gb_string.h @@ -2,6 +2,7 @@ A Simple Dynamic Strings Library for C and C++ Version History: + 0.95b - Fix issue #21 0.95a - Change brace style because why not? 0.95 - C90 Support 0.94 - Remove "declare anywhere" @@ -325,11 +326,10 @@ gbString gb_make_string_length(void const *init_str, gbUsize len) { gbStringHeader *header; gbUsize header_size = sizeof(gbStringHeader); void *ptr = GB_ALLOC(header_size + len + 1); - if (!init_str) - memset(ptr, 0, header_size + len + 1); - if (ptr == GB_NULLPTR) return GB_NULLPTR; + if (!init_str) + memset(ptr, 0, header_size + len + 1); str = (char *)ptr + header_size; header = GB_STRING_HEADER(str); |
