summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-05-23 23:48:08 +0100
committerVincent Sanders <vince@kyllikki.org>2020-05-23 23:48:38 +0100
commitdbe63210cfc3405f434b2e10697f33da37e7c19d (patch)
treead44f20b1cb366a4f25c1313076ee58cff966bf3 /content
parentfe429e8d2d76c34b0432acb1f579d62ecfe374de (diff)
downloadnetsurf-dbe63210cfc3405f434b2e10697f33da37e7c19d.tar.gz
netsurf-dbe63210cfc3405f434b2e10697f33da37e7c19d.tar.bz2
fix use of uninitialised warning on older gcc
Diffstat (limited to 'content')
-rw-r--r--content/handlers/text/textplain.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c
index c72846998..b5ad0aec3 100644
--- a/content/handlers/text/textplain.c
+++ b/content/handlers/text/textplain.c
@@ -1592,10 +1592,12 @@ textplain_textselection_copy(struct content *c,
{
const char *text;
size_t length;
- bool res;
+ bool res = false;
text = textplain_get_raw_data(c, start_idx, end_idx, &length);
- res = selection_string_append(text, length, false, NULL, selstr);
+ if (text != NULL) {
+ res = selection_string_append(text, length, false, NULL, selstr);
+ }
if (res == false) {
return NSERROR_NOMEM;
}