From fd88428545cac94db72e93a1ff36c27153628874 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Tue, 7 Feb 2017 20:13:56 +0000 Subject: [PATCH] Fix issue #21 --- gb_string.h | 6 +++--- 1 file 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);