From 8f304f558dce295d396e0001b5466c594ca8166a Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Tue, 6 Dec 2016 10:17:57 +0000 Subject: [PATCH] Cleanup maybe-uninitialized compiler warnings. Found by GCC 6.2.0. Signed-off-by: Andreas Mohr Signed-off-by: Andrew Borodin --- src/diffviewer/search.c | 2 +- src/editor/editcmd_dialogs.c | 4 ++-- src/execute.c | 2 +- src/main.c | 2 +- src/vfs/sftpfs/file.c | 2 +- src/viewer/dialogs.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/diffviewer/search.c b/src/diffviewer/search.c index 9504ebe70..735f22c0d 100644 --- a/src/diffviewer/search.c +++ b/src/diffviewer/search.c @@ -74,7 +74,7 @@ mcdiffview_dialog_search (WDiff * dview) { char *exp = NULL; int qd_result; - size_t num_of_types; + size_t num_of_types = 0; gchar **list_of_types; list_of_types = mc_search_get_types_strings_array (&num_of_types); diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c index 007e69a51..6eefb72fa 100644 --- a/src/editor/editcmd_dialogs.c +++ b/src/editor/editcmd_dialogs.c @@ -92,7 +92,7 @@ gboolean editcmd_dialog_search_show (WEdit * edit) { char *search_text; - size_t num_of_types; + size_t num_of_types = 0; gchar **list_of_types; int dialog_result; @@ -188,7 +188,7 @@ void editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const char *replace_default, /*@out@ */ char **search_text, /*@out@ */ char **replace_text) { - size_t num_of_types; + size_t num_of_types = 0; gchar **list_of_types; if ((search_default == NULL) || (*search_default == '\0')) diff --git a/src/execute.c b/src/execute.c index 1cf007570..d22e4a3fe 100644 --- a/src/execute.c +++ b/src/execute.c @@ -622,7 +622,7 @@ execute_external_editor_or_viewer (const char *command, const vfs_path_t * filen vfs_path_t *localcopy_vpath = NULL; const vfs_path_t *do_execute_vpath; char *extern_cmd_options; - time_t mtime; + time_t mtime = 0; if (!execute_prepare_with_vfs_arg (filename_vpath, &localcopy_vpath, &mtime)) return; diff --git a/src/main.c b/src/main.c index c413b2559..9b8770f5a 100644 --- a/src/main.c +++ b/src/main.c @@ -219,7 +219,7 @@ main (int argc, char *argv[]) { GError *mcerror = NULL; gboolean config_migrated = FALSE; - char *config_migrate_msg; + char *config_migrate_msg = NULL; int exit_code = EXIT_FAILURE; mc_global.timer = mc_timer_new (); diff --git a/src/vfs/sftpfs/file.c b/src/vfs/sftpfs/file.c index bfdd4f369..8807cfb06 100644 --- a/src/vfs/sftpfs/file.c +++ b/src/vfs/sftpfs/file.c @@ -156,7 +156,7 @@ sftpfs_open_file (vfs_file_handler_t * file_handler, int flags, mode_t mode, GEr if (do_append) { - struct stat file_info; + struct stat file_info = { 0 }; if (sftpfs_fstat (file_handler, &file_info, mcerror) == 0) libssh2_sftp_seek64 (file_handler_data->handle, file_info.st_size); diff --git a/src/viewer/dialogs.c b/src/viewer/dialogs.c index 844b9ae94..756097774 100644 --- a/src/viewer/dialogs.c +++ b/src/viewer/dialogs.c @@ -78,7 +78,7 @@ mcview_dialog_search (WView * view) { char *exp = NULL; int qd_result; - size_t num_of_types; + size_t num_of_types = 0; gchar **list_of_types; list_of_types = mc_search_get_types_strings_array (&num_of_types);