Coverity CID 2399: Move strcpy lower, where it is actually going to be

used, inside the test of directory != NULL.
This commit is contained in:
christos 2006-03-26 21:44:05 +00:00
parent 34525befc6
commit e4dcd1072c
1 changed files with 5 additions and 4 deletions

9
dist/cdk/fselect.c vendored
View File

@ -1,9 +1,9 @@
#include <cdk.h>
/*
* $Author: garbled $
* $Date: 2001/01/04 19:58:11 $
* $Revision: 1.1.1.1 $
* $Author: christos $
* $Date: 2006/03/26 21:44:05 $
* $Revision: 1.2 $
*/
/*
@ -349,7 +349,6 @@ void setCDKFselect (CDKFSELECT *fselect, char *directory, chtype fieldAttrib, ch
fselect->fieldAttribute = fieldAttrib;
fselect->fillerCharacter = filler;
fselect->highlight = highlight;
strcpy (newDirectory, directory);
/* Set the attributes of the entry field/scrolling list. */
setCDKEntryFillerChar (fentry, filler);
@ -368,6 +367,8 @@ void setCDKFselect (CDKFSELECT *fselect, char *directory, chtype fieldAttrib, ch
freeChar (tempDir);
}
}
else
strcpy (newDirectory, directory);
/* Change directories. */
ret = chdir (newDirectory);