Skip to content

Commit 89809e7

Browse files
committed
fix: interpret len as byte count in nk_str_insert_text_char and nk_str_insert_str_char
1 parent 171090c commit 89809e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/nuklear_string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len)
167167
NK_API int
168168
nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len)
169169
{
170-
return nk_str_insert_text_utf8(str, pos, text, len);
170+
return nk_str_insert_at_rune(str, pos, text, len) ? len : 0;
171171
}
172172
NK_API int
173173
nk_str_insert_str_char(struct nk_str *str, int pos, const char *text)
174174
{
175-
return nk_str_insert_text_utf8(str, pos, text, nk_strlen(text));
175+
return nk_str_insert_text_char(str, pos, text, nk_strlen(text));
176176
}
177177
NK_API int
178178
nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)

0 commit comments

Comments
 (0)