From: Kevin Day Date: Thu, 30 Apr 2020 02:50:56 +0000 (-0500) Subject: Bugfix: The address has to exist to use, all references with address of 0 are invalid... X-Git-Tag: 0.5.0~312 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=7ac69299e145fd77521db00b8f503b7de3762fb6;p=fll Bugfix: The address has to exist to use, all references with address of 0 are invalid parameters Oops. --- diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index 81cdfbe..6729436 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -264,10 +264,7 @@ extern "C" { f_status status = f_none; - if (result == 0) { - f_macro_string_dynamic_new(status, (*result), size); - } - else if (size > result->size) { + if (size > result->size) { f_macro_string_dynamic_resize(status, (*result), size); } @@ -289,10 +286,7 @@ extern "C" { f_status status = f_none; - if (result == 0) { - f_macro_string_dynamic_new(status, (*result), size); - } - else if (size > result->size) { + if (size > result->size) { f_macro_string_dynamic_resize(status, (*result), size); } diff --git a/level_1/fl_string/c/string.c b/level_1/fl_string/c/string.c index ad606f1..7edb64f 100644 --- a/level_1/fl_string/c/string.c +++ b/level_1/fl_string/c/string.c @@ -528,6 +528,7 @@ extern "C" { f_return_status fl_string_rip(const f_string string, const f_string_length start, const f_string_length stop, f_string_dynamic *result) { #ifndef _di_level_1_parameter_checking_ if (start > stop) return f_status_set_error(f_invalid_parameter); + if (result == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_string_rip(string, start, stop, result); @@ -538,6 +539,7 @@ extern "C" { f_return_status fl_string_rip_trim(const f_string string, const f_string_length start, const f_string_length stop, f_string_dynamic *result) { #ifndef _di_level_1_parameter_checking_ if (start > stop) return f_status_set_error(f_invalid_parameter); + if (result == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_string_rip_trim(string, start, stop, result);