From: Kevin Day Date: Sat, 18 Jul 2020 05:08:06 +0000 (-0500) Subject: Bugfix: f_string_range initialize macros need to consider used = 0 case. X-Git-Tag: 0.5.0~80 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=7ed1bf87a7ba67c8206acec4e6e80b9f87d09021;p=fll Bugfix: f_string_range initialize macros need to consider used = 0 case. --- diff --git a/level_0/f_string/c/string_range.h b/level_0/f_string/c/string_range.h index 1d503b3..c3460b3 100644 --- a/level_0/f_string/c/string_range.h +++ b/level_0/f_string/c/string_range.h @@ -36,7 +36,7 @@ extern "C" { #define f_string_range_initialize { 1, 0 } - #define f_macro_string_range_initialize(length) { 0, length - 1 } + #define f_macro_string_range_initialize(length) { length ? 0 : 1, length ? length - 1 : 0 } #define f_macro_string_range_clear(range) \ range.start = 1; \ diff --git a/level_0/f_utf/c/utf-common.h b/level_0/f_utf/c/utf-common.h index d7f4643..d5e3960 100644 --- a/level_0/f_utf/c/utf-common.h +++ b/level_0/f_utf/c/utf-common.h @@ -192,7 +192,7 @@ extern "C" { #define f_utf_string_range_initialize { 1, 0 } - #define f_macro_utf_string_range_initialize(length) { 0, length - 1 } + #define f_macro_utf_string_range_initialize(length) { length ? 0 : 1, length ? length - 1 : 0 } #define f_macro_utf_string_range_new(status, utf_string_range, length) status = f_memory_new((void **) & utf_string_range, sizeof(f_utf_string_range), length) #define f_macro_utf_string_range_delete(status, utf_string_range, size) status = f_memory_delete((void **) & utf_string_range, sizeof(f_utf_string_range), size)