summaryrefslogtreecommitdiffstats
path: root/src/dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-11-18 20:13:10 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-11-18 20:13:10 +0100
commit5cfae9ea3a0a5ec79335dc73b7671d038dc84dcf (patch)
treebfa738f32c63b2928f5fc81c46092015c98f3eb6 /src/dir.c
parentd000e5e9eb89ee0c2e7f9a9db122eb1cf027de88 (diff)
dir.c: code cleanup
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dir.c b/src/dir.c
index 5cfa1a6..a1cb33f 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -478,7 +478,7 @@ static long int dir_aff_ncurses(disk_t *disk, const partition_t *partition, dir_
case 'c':
if(dir_data->copy_file!=NULL)
{
- unsigned int current_directory_namelength=strlen(dir_data->current_directory);
+ const unsigned int current_directory_namelength=strlen(dir_data->current_directory);
if(strcmp(pos->name,"..")!=0 &&
current_directory_namelength+1+strlen(pos->name)<sizeof(dir_data->current_directory)-1)
{
@@ -488,13 +488,12 @@ static long int dir_aff_ncurses(disk_t *disk, const partition_t *partition, dir_
strcat(dir_data->current_directory,pos->name);
if(dir_data->local_dir==NULL)
{
- char *res;
if(LINUX_S_ISDIR(pos->stat.st_mode)!=0)
- res=ask_location("Are you sure you want to copy %s and any files below to the directory %s ? [Y/N]",dir_data->current_directory);
+ dir_data->local_dir=ask_location("Are you sure you want to copy %s and any files below to the directory %s ? [Y/N]",
+ dir_data->current_directory);
else
- res=ask_location("Are you sure you want to copy %s to the directory %s ? [Y/N]",dir_data->current_directory);
- // free(dir_data->local_dir);
- dir_data->local_dir=res;
+ dir_data->local_dir=ask_location("Are you sure you want to copy %s to the directory %s ? [Y/N]",
+ dir_data->current_directory);
}
if(dir_data->local_dir!=NULL)
{