From dbe63210cfc3405f434b2e10697f33da37e7c19d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 23 May 2020 23:48:08 +0100 Subject: fix use of uninitialised warning on older gcc --- content/handlers/text/textplain.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'content') 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; } -- cgit v1.2.3