Stops if argc <= 0

This commit is contained in:
Christophe Grenier 2022-01-27 09:04:41 +01:00
parent 61f7103e0d
commit 4d988b1c2f
2 changed files with 4 additions and 0 deletions

View file

@ -168,6 +168,8 @@ int main( int argc, char **argv )
.list_file_format=array_file_enable
};
struct ph_param params;
if(argc <= 0)
return 1;
params.recup_dir=NULL;
params.cmd_device=NULL;
params.cmd_run=NULL;

View file

@ -233,6 +233,8 @@ int main( int argc, char **argv )
const char *logfile="testdisk.log";
int log_opened=0;
int log_errno=0;
if(argc <= 0)
return 1;
/* srand needed for GPT creation (weak is ok) */
srand(time(NULL));
#ifdef HAVE_SIGACTION