summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-01-05 17:36:33 +0000
committerAlastair Poole <netstar@gmail.com>2020-01-05 17:36:33 +0000
commit207da69c97d86ccd6f1e354b60b579a3d81f375c (patch)
tree72a5d5f355baf641e82548aa0d718cce40f31333
parentf2b88560a091d1f8c8a72b0237273475b4da5328 (diff)
elm_code_text: Return empty string on 0 length.
Throughout elm_code we rely on this function returning a valid string (unless the line object isn't set/is NULL).
-rw-r--r--src/lib/elementary/elm_code_text.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_code_text.c b/src/lib/elementary/elm_code_text.c
index d27081a251..56fc1a07c5 100644
--- a/src/lib/elementary/elm_code_text.c
+++ b/src/lib/elementary/elm_code_text.c
@@ -19,6 +19,9 @@ elm_code_line_text_get(Elm_Code_Line *line, unsigned int *length)
19 if (length) 19 if (length)
20 *length = line->length; 20 *length = line->length;
21 21
22 if (!line->length)
23 return "";
24
22 if (line->modified) 25 if (line->modified)
23 return line->modified; 26 return line->modified;
24 return line->content; 27 return line->content;