Skip to content

Commit

Permalink
Edited the format len offset at line 221 and 224
Browse files Browse the repository at this point in the history
  • Loading branch information
rmknan committed Sep 19, 2023
1 parent c67c883 commit 13a1824
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/element.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 13a1824

Please sign in to comment.