button_get_text() shouldn't return 'const'.

As it's a newly allocated string which the caller needs to free.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Mooffie 2015-11-13 16:11:29 +02:00 committed by Andrew Borodin
parent 2627da4b73
commit 5fad7508c5
2 changed files with 2 additions and 2 deletions

View File

@ -222,7 +222,7 @@ button_new (int y, int x, int action, button_flags_t flags, const char *text, bc
/* --------------------------------------------------------------------------------------------- */
const char *
char *
button_get_text (const WButton * b)
{
if (b->text.hotkey != NULL)

View File

@ -46,7 +46,7 @@ typedef struct WButton
WButton *button_new (int y, int x, int action, button_flags_t flags, const char *text,
bcback_fn callback);
const char *button_get_text (const WButton * b);
char *button_get_text (const WButton * b);
void button_set_text (WButton * b, const char *text);
int button_get_len (const WButton * b);