From 615ecfdd401c70bdf9faaf3e3125f793d76476bf Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sat, 24 Aug 2019 01:39:09 +0200 Subject: pluma-document: avoid garbarge value in 'file_with_bom' function Fixes clang analyzer warning: pluma-document.c:682:14: warning: The left operand of '==' is a garbage value if ((bom[0] == '\357') && ~~~~~~ ^ --- pluma/pluma-document.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pluma/pluma-document.c b/pluma/pluma-document.c index b9519b25..11a5dc65 100644 --- a/pluma/pluma-document.c +++ b/pluma/pluma-document.c @@ -659,6 +659,8 @@ file_with_bom (GFile *file) gchar bom[3]; gchar *file_path; + bom[0] = bom[1] = bom[2] = 0; + file_path = g_file_get_path (file); testfile = fopen (file_path, "r"); -- cgit v1.2.1