Moved variable definition into its proper ifdef case. Coverity CID 28702.

This commit is contained in:
Thomas Schmitt 2015-11-08 14:33:12 +00:00
parent 72ce15a9fb
commit 39ecb4e12d
2 changed files with 7 additions and 2 deletions

View File

@ -324,11 +324,12 @@ int Xorriso_dialog_input(struct XorrisO *xorriso, char line[], int linesize,
bit5= write to history in any case (if it is enabled at compile time) bit5= write to history in any case (if it is enabled at compile time)
*/ */
{ {
char *cpt= NULL, **argv= NULL, *linept, *why_append= ""; char **argv= NULL, *linept, *why_append= "";
int ret, argc= 0, base_length= 0, l, append_line; int ret, argc= 0, base_length= 0, l, append_line;
#ifdef Xorriso_with_line_editoR #ifdef Xorriso_with_line_editoR
static char last_input[SfileadrL]= {""}; static char last_input[SfileadrL]= {""};
int no_history= 0; int no_history= 0;
char *cpt= NULL;
#endif /* Xorriso_with_line_editoR */ #endif /* Xorriso_with_line_editoR */
double tdiff; double tdiff;
struct timeval tv; struct timeval tv;
@ -478,8 +479,12 @@ put_into_history:;
ret= 1; ret= 1;
ex:; ex:;
#ifdef Xorriso_with_line_editoR
if(cpt!=NULL) if(cpt!=NULL)
free(cpt); free(cpt);
#endif
gettimeofday(&tv,&tz); gettimeofday(&tv,&tz);
xorriso->idle_time+= tv.tv_sec+(1.e-6*(double) tv.tv_usec)-tdiff; xorriso->idle_time+= tv.tv_sec+(1.e-6*(double) tv.tv_usec)-tdiff;
return(ret); return(ret);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.11.08.140544" #define Xorriso_timestamP "2015.11.08.143244"