diff options
author | Vincent Sanders <vince@kyllikki.org> | 2020-05-23 23:48:08 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2020-05-23 23:48:38 +0100 |
commit | dbe63210cfc3405f434b2e10697f33da37e7c19d (patch) | |
tree | ad44f20b1cb366a4f25c1313076ee58cff966bf3 /content/handlers/text | |
parent | fe429e8d2d76c34b0432acb1f579d62ecfe374de (diff) | |
download | netsurf-dbe63210cfc3405f434b2e10697f33da37e7c19d.tar.gz netsurf-dbe63210cfc3405f434b2e10697f33da37e7c19d.tar.bz2 |
fix use of uninitialised warning on older gcc
Diffstat (limited to 'content/handlers/text')
-rw-r--r-- | content/handlers/text/textplain.c | 6 |
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; } |