1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-12-25 09:14:35 +00:00

Fix crash when config folder doesn't exist

This commit is contained in:
cathery 2020-12-07 18:14:03 +03:00
parent f8b472fda9
commit c9012b7c95
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#include "switch.h"
#include "log.h"
#include "config_handler.h"
#include <sys/stat.h>
#include <stratosphere.hpp>
static ams::os::Mutex printMutex(false);
@ -35,6 +35,8 @@ void WriteToLog(const char *fmt, ...)
ams::TimeSpan ts = ams::os::ConvertToTimeSpan(ams::os::GetSystemTick());
mkdir(CONFIG_PATH, 777);
FILE *fp = fopen(LOG_PATH, "a");
//Print time

View File

@ -1,4 +1,5 @@
#pragma once
#include "config_handler.h"
#define LOG_PATH CONFIG_PATH "log.txt"