Skip to content

Commit

Permalink
malloc kind of wants its friend free back
Browse files Browse the repository at this point in the history
  • Loading branch information
meladroit committed Sep 10, 2015
1 parent 8b4bb94 commit a6c27f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions source/main.c
Expand Up @@ -106,19 +106,21 @@ void copyFile(lsDir* dir, char* path, u64 size, lsDir* destDir)
default:
break;
}

char* deletePath = (char*)malloc(strlen(dir->thisDir)+strlen(path)+1);
strcpy(deletePath,dir->thisDir);
strcat(deletePath,path);
if(canHasConsole)
{
debugOut("about to overwrite file");
printf(" deletePath %s",deletePath);
if (detectOverwrite(path,destDir)) {
char* deletePath = (char*)malloc(strlen(dir->thisDir)+strlen(path)+1);
strcpy(deletePath,dir->thisDir);
strcat(deletePath,path);
if(canHasConsole)
{
debugOut("about to overwrite file");
printf(" deletePath %s",deletePath);
}
if (curArchive==&sdmcArchive)
deleteFile(deletePath,&saveGameArchive,&saveGameFsHandle);
if (curArchive==&saveGameArchive)
deleteFile(deletePath,&sdmcArchive,&sdmcFsHandle);
free(deletePath);
}
if (curArchive==&sdmcArchive)
deleteFile(deletePath,&saveGameArchive,&saveGameFsHandle);
if (curArchive==&saveGameArchive)
deleteFile(deletePath,&sdmcArchive,&sdmcFsHandle);

char origpath[MAX_PATH_LENGTH] = {0};
char destpath[MAX_PATH_LENGTH] = {0};
Expand Down
Binary file modified svdt.3dsx
Binary file not shown.

0 comments on commit a6c27f3

Please sign in to comment.