From a11223c5ced0de7ce1e05ce06741496ea68fece1 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Tue, 6 Dec 2016 10:05:47 +0000
Subject: [PATCH] (editcmd_dialogs.c) Cleanup maybe-uninitialized compiler warning
Found by GCC 6.2.0.
editcmd_dialogs.c: In function 'editcmd_dialog_replace_show':
editcmd_dialogs.c:200:24: error: 'num_of_types' may be used uninitialized in this function [-Werror=maybe-uninitialized]
editcmd_dialogs.c:191:12: note: 'num_of_types' was declared here
editcmd_dialogs.c: In function 'editcmd_dialog_search_show':
editcmd_dialogs.c:102:24: error: 'num_of_types' may be used uninitialized in this function [-Werror=maybe-uninitialized]
editcmd_dialogs.c:95:12: note: 'num_of_types' was declared here
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/editor/editcmd_dialogs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c
index 007e69a..6eefb72 100644
a
|
b
|
gboolean |
92 | 92 | editcmd_dialog_search_show (WEdit * edit) |
93 | 93 | { |
94 | 94 | char *search_text; |
95 | | size_t num_of_types; |
| 95 | size_t num_of_types = 0; |
96 | 96 | gchar **list_of_types; |
97 | 97 | int dialog_result; |
98 | 98 | |
… |
… |
void |
188 | 188 | editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const char *replace_default, |
189 | 189 | /*@out@ */ char **search_text, /*@out@ */ char **replace_text) |
190 | 190 | { |
191 | | size_t num_of_types; |
| 191 | size_t num_of_types = 0; |
192 | 192 | gchar **list_of_types; |
193 | 193 | |
194 | 194 | if ((search_default == NULL) || (*search_default == '\0')) |