Skip to content
Myr

Fix multiple string multiplication

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by itchyny · committed by William Langford · parent 15fa1de · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:src/builtin.c+3 added-2 removed
320 unmodified lines
321 num = a;322 }323 int n;324 size_t alen = jv_string_length_bytes(jv_copy(str));325 jv res = str;325 jv res = jv_copy(str);326327 for (n = jv_number_value(num) - 1; n > 0; n--)328 res = jv_string_append_buf(res, jv_string_value(str), alen);329330 jv_free(str);331 jv_free(num);332 if (n < 0) {332 jv_free(str);333 jv_free(res);334 return jv_null();335 }336 return res;337 } else if (ak == JV_KIND_OBJECT && bk == JV_KIND_OBJECT) {
1483 unmodified lines