From 996e372b1b8dfad2d2cecd219ddc6c25a6cb36f9 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 2ae087b3..21a2c68b 100644 --- a/pluma/pluma-document.c +++ b/pluma/pluma-document.c @@ -655,6 +655,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