Skip to content

Commit

Permalink
Fixed crash caused by a file check under a missing directory
Browse files Browse the repository at this point in the history
  • Loading branch information
joel16 committed Aug 18, 2016
1 parent 7a2419a commit a10c2e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main(int argc, char *argv[])
char *str_ver = malloc(255), *str_sysver = malloc(255);
u32 os_ver = osGetKernelVersion(), firm_ver = osGetKernelVersion();

printf("\x1b[32m3DSident 0.3\x1b[0m\n\n");
printf("\x1b[32m3DSident 0.3.1\x1b[0m\n\n");

snprintf(str_ver, 255, "\x1b[33m*\x1b[0m Kernel version: %lu.%lu-%lu\n\x1b[33m*\x1b[0m FIRM version is %lu.%lu-%lu\n",
GET_VERSION_MAJOR(os_ver), GET_VERSION_MINOR(os_ver), GET_VERSION_REVISION(os_ver),
Expand Down Expand Up @@ -176,7 +176,7 @@ int main(int argc, char *argv[])
if (nnidNum != 0xFFFFFFFF)
printf("\x1b[34m*\x1b[0m NNID: %08X\n\n", (int) nnidNum);
else
printf("\x1b[34m*\x1b[0m NNID: Error could not retreive NNID\n\n");
printf("\x1b[34m*\x1b[0m NNID: Error could not retrieve NNID\n\n");

printf("\x1b[32m*\x1b[0m SD Detected: %s\n", detectSD() ? "Yes" : "No");

Expand Down
12 changes: 6 additions & 6 deletions source/screenshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,17 @@ int screenshotConfig(int data)

void captureScreenshot()
{
if (!(dirExists("/3ds/3DSident")))
makeDir("/3ds/3DSident");

if (!(dirExists("/3ds/3DSident/screenshots")))
makeDir("/3ds/3DSident/screenshots");

screenCapture = screenshotConfig(screenCapture);

if (fileExists("/3ds/3DSident/screenshots/"))
deleteFile("/3ds/3DSident/screenshots/");

if (!dirExists("/3ds/3DSident"))
makeDir("/3ds/3DSident");

if (!dirExists("/3ds/3DSident/screenshots"))
makeDir("/3ds/3DSident/screenshots");

if (screenCapture == 1)
screenshot_png(screenshotPath, Z_NO_COMPRESSION);
}

0 comments on commit a10c2e6

Please sign in to comment.