summaryrefslogtreecommitdiff
path: root/desktop/textarea.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/textarea.c')
-rw-r--r--desktop/textarea.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index f573e40bc..eac21699d 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -252,6 +252,9 @@ int textarea_get_text(struct text_area *ta, char *buf, unsigned int len)
if (buf == NULL && len == 0) {
/* want length */
return ta->text_len;
+ } else if (buf == NULL) {
+ /* Can't write to NULL */
+ return -1;
}
if (len < ta->text_len) {