diff options
Diffstat (limited to 'src/gui/text_widget.c')
-rw-r--r-- | src/gui/text_widget.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/text_widget.c b/src/gui/text_widget.c index eea2613..db237af 100644 --- a/src/gui/text_widget.c +++ b/src/gui/text_widget.c @@ -24,9 +24,7 @@ void text_widget_init( text_widget_t *widget, widget_t *parent, const int x, con widget_init( &widget->base, parent, x, y, w, h, background_color ); - // TODO: const for now, caller has to preserve the text - // maybe with memory manager in place we can do this with a strdup - widget->s = s; + text_widget_set_text( widget, s ); widget->base.vtable = (widget_vtable_t *)&text_widget_vtable; widget->vtable = &text_widget_vtable; @@ -61,7 +59,6 @@ void text_widget_set_text( void *obj, const char *s ) { text_widget_t *widget = obj; - // TODO: see above - widget->s = s; + strlcpy( widget->s, s, TEXT_WIDGET_MAX_TEXT_SIZE ); } |