summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-24 01:39:09 +0200
committermonsta <[email protected]>2020-02-13 14:02:54 +0300
commit615ecfdd401c70bdf9faaf3e3125f793d76476bf (patch)
tree992a22b01a10103fa16323c76954fa54be58dd21
parentac964e63be856db9ffa61fa2b9bc578a2bfb77b4 (diff)
downloadpluma-615ecfdd401c70bdf9faaf3e3125f793d76476bf.tar.bz2
pluma-615ecfdd401c70bdf9faaf3e3125f793d76476bf.tar.xz
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') && ~~~~~~ ^
-rw-r--r--pluma/pluma-document.c2
1 files changed, 2 insertions, 0 deletions
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");