Skip to content

Commit 0f00ebc

Browse files
committed
ui: fix text area buffer
1 parent c023d6e commit 0f00ebc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/sources/iron_ui.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3183,12 +3183,13 @@ char *ui_text_area(ui_handle_t *handle, int align, bool editable, char *label, b
31833183
handle->text = string_replace_all(handle->text, "\t", " ");
31843184
bool selected = current->text_selected_handle == handle; // Text being edited
31853185

3186-
int text_size = strlen(handle->text) + 1;
3186+
int text_size = strlen(handle->text) + 1 + 1024;
31873187
if (lines_size < text_size) {
31883188
if (lines_buffer != NULL) {
31893189
free(lines_buffer);
31903190
}
31913191
lines_buffer = malloc(text_size);
3192+
lines_size = text_size;
31923193
}
31933194

31943195
char *lines = lines_buffer;

0 commit comments

Comments
 (0)