From 078f46752f2fed4df0f441ef41563144984b4c69 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Fri, 13 Nov 2015 16:11:29 +0200
Subject: [PATCH] button_get_text() shouldn't return 'const'.
As it's a newly allocated string which the caller needs to free.
---
lib/widget/button.c | 2 +-
lib/widget/button.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/widget/button.c b/lib/widget/button.c
index 055602e..cf7de6d 100644
a
|
b
|
button_new (int y, int x, int action, button_flags_t flags, const char *text, bc |
222 | 222 | |
223 | 223 | /* --------------------------------------------------------------------------------------------- */ |
224 | 224 | |
225 | | const char * |
| 225 | char * |
226 | 226 | button_get_text (const WButton * b) |
227 | 227 | { |
228 | 228 | if (b->text.hotkey != NULL) |
diff --git a/lib/widget/button.h b/lib/widget/button.h
index f85be8b..278b2d3 100644
a
|
b
|
typedef struct WButton |
46 | 46 | |
47 | 47 | WButton *button_new (int y, int x, int action, button_flags_t flags, const char *text, |
48 | 48 | bcback_fn callback); |
49 | | const char *button_get_text (const WButton * b); |
| 49 | char *button_get_text (const WButton * b); |
50 | 50 | void button_set_text (WButton * b, const char *text); |
51 | 51 | int button_get_len (const WButton * b); |
52 | 52 | |