From a10c2e6b9951a5e4176ebb0b65625ac506f10b4f Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 18 Aug 2016 19:45:15 +0530 Subject: [PATCH] Fixed crash caused by a file check under a missing directory --- source/main.c | 4 ++-- source/screenshot.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/main.c b/source/main.c index 5ff888e..e7dd8db 100644 --- a/source/main.c +++ b/source/main.c @@ -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), @@ -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"); diff --git a/source/screenshot.c b/source/screenshot.c index 602e422..becb9e7 100644 --- a/source/screenshot.c +++ b/source/screenshot.c @@ -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); } \ No newline at end of file