From b2bee8ac8399eceaa6054b7d59d8f05cd1ad6fc4 Mon Sep 17 00:00:00 2001 From: Martijn van Brummelen Date: Fri, 16 Nov 2018 22:20:48 +0100 Subject: [PATCH] Fixes uninitialized variable warning --- src/gui.c | 3 +-- src/nwipe.c | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui.c b/src/gui.c index 609d504..5f31493 100644 --- a/src/gui.c +++ b/src/gui.c @@ -995,7 +995,7 @@ void nwipe_gui_prng( void ) if( nwipe_options.prng == &nwipe_isaac ) { focus = 1; } - do + while( keystroke != ERR ) { /* Clear the main window. */ werase( main_window ); @@ -1086,7 +1086,6 @@ void nwipe_gui_prng( void ) } /* switch */ } /* while */ - while( keystroke != ERR ) } /* nwipe_gui_prng */ diff --git a/src/nwipe.c b/src/nwipe.c index 0dec569..8a324cf 100644 --- a/src/nwipe.c +++ b/src/nwipe.c @@ -20,10 +20,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ +#define _POSIX_SOURCE #include #include #include +#include +#include +#include #include "nwipe.h" #include "context.h" @@ -142,6 +146,7 @@ int main( int argc, char** argv ) nwipe_thread_data_ptr.c = c2; nwipe_misc_thread_data.nwipe_enumerated = nwipe_enumerated; + nwipe_misc_thread_data.nwipe_selected = 0; if( !nwipe_options.nogui ) nwipe_misc_thread_data.gui_thread = &nwipe_gui_thread; nwipe_thread_data_ptr.nwipe_misc_thread_data = &nwipe_misc_thread_data; @@ -566,12 +571,14 @@ void *signal_hand(void *ptr) case SIGQUIT : case SIGTERM : { + nwipe_log( NWIPE_LOG_INFO, "nwipe_selected = %lu", nwipe_misc_thread_data->nwipe_selected ); for( i = 0; i < nwipe_misc_thread_data->nwipe_selected; i++ ) { if ( c[i]->thread ) { + nwipe_log( NWIPE_LOG_INFO, "Cancelling thread for %s", c[i]->device_name ); pthread_cancel( c[i]->thread ); } }