removed malloc from TimEditState_construct

This commit is contained in:
2026-01-12 22:51:33 +05:00
parent c5328cb9ed
commit 7a3bde6321
3 changed files with 14 additions and 16 deletions

View File

@@ -126,8 +126,10 @@ static inline void test_screen(TimEvent* e) {
}
i32 main(void) {
TimEditState_construct(&ed1, 32, "Edit 1");
TimEditState_construct(&ed2, 32, "");
char ed1_buf[32];
char ed2_buf[32];
TimEditState_construct(&ed1, ed1_buf, ARRAY_SIZE(ed1_buf), "Edit 1");
TimEditState_construct(&ed2, ed2_buf, ARRAY_SIZE(ed2_buf), NULL);
while (tim_run(1.5)) {
test_screen(&tim->event);
@@ -135,9 +137,6 @@ i32 main(void) {
break;
}
}
TimEditState_destroy(&ed1);
TimEditState_destroy(&ed2);
return 0;
}