summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_code_text.c
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-04-05 22:40:43 +0100
committerAndy Williams <andy@andywilliams.me>2017-04-05 22:40:43 +0100
commit650606ab90484693eb7813fe5ebf5216e9e18787 (patch)
tree0ee2f106f2d2f7bdab10267cdeafd081cc31061b /src/lib/elementary/elm_code_text.c
parent5da4c96087260ff50e0e76fe69e5de5121a9accc (diff)
elm_code: better safety around widget edge cases
Fixes crashes when dragging selection out of widget. @fix
Diffstat (limited to 'src/lib/elementary/elm_code_text.c')
-rw-r--r--src/lib/elementary/elm_code_text.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_text.c b/src/lib/elementary/elm_code_text.c
index bf25514..1ebdb09 100644
--- a/src/lib/elementary/elm_code_text.c
+++ b/src/lib/elementary/elm_code_text.c
@@ -10,7 +10,11 @@ EAPI const char *
10elm_code_line_text_get(Elm_Code_Line *line, unsigned int *length) 10elm_code_line_text_get(Elm_Code_Line *line, unsigned int *length)
11{ 11{
12 if (!line) 12 if (!line)
13 return NULL; 13 {
14 if (length)
15 *length = 0;
16 return NULL;
17 }
14 18
15 if (length) 19 if (length)
16 *length = line->length; 20 *length = line->length;