From 13a182403ef695fcb62a48280c681488905a8d6e Mon Sep 17 00:00:00 2001 From: rmknan Date: Tue, 19 Sep 2023 16:26:04 -0400 Subject: [PATCH] Edited the format len offset at line 221 and 224 --- src/element.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/element.c b/src/element.c index 994b5af8d..ff13bc2e4 100644 --- a/src/element.c +++ b/src/element.c @@ -218,10 +218,10 @@ stumpless_element_to_string( const struct stumpless_element *element ) { if( param_count != 0 ) { // extra param list chars and commas - format_len += 6 + param_count - 1; + format_len += 4 + param_count - 1; } else { // no params, just name - format_len += 3; + format_len += 1; } format = alloc_mem( format_len ); @@ -253,8 +253,8 @@ stumpless_element_to_string( const struct stumpless_element *element ) { format[pos_offset] = ']'; } else { // name (no params) - // pos_offset is name_len + 4 here - pos_offset -= 3; + // pos_offset is name_len + 2 here + pos_offset -= 1; } format[pos_offset + 1] = '\0';