diff --git a/src/lib/picsimlab.cc b/src/lib/picsimlab.cc index 4a2400b9..24581c8a 100644 --- a/src/lib/picsimlab.cc +++ b/src/lib/picsimlab.cc @@ -1105,7 +1105,7 @@ void CPICSimLab::Configure(const char* home, int use_default_board, int create, char btdir[256]; SystemCmd(PSC_GETTEMPDIR, "PICSimLab", btdir); std::string fbackup = std::string(btdir) + "/backup_" + std::string(boards_list[GetLab()].name) + "_" + - std::to_string(clock()) + ".pzw"; + std::to_string(time(NULL)) + ".pzw"; SaveWorkspace(fbackup); SetWorkspaceFileName(""); } diff --git a/src/picsimlab1.cc b/src/picsimlab1.cc index 0c6cb557..18f22d1f 100644 --- a/src/picsimlab1.cc +++ b/src/picsimlab1.cc @@ -762,7 +762,7 @@ void CPWindow1::_EvOnCreate(CControl* control) { #if !defined(__EMSCRIPTEN__) && !defined(_CONSOLE_LOG_) snprintf(fname, 1199, "%s/picsimlab_log%i.txt", home, PICSimLab.GetInstanceNumber()); - printf("PICSimLab: Output redirect to file: \"%s\"\n", fname); + printf("PICSimLab: Console output redirected to file: \"%s\"\n", fname); if (PICSimLab.SystemCmd(PSC_FILEEXISTS, fname)) { FILE* flog = fopen_UTF8(fname, "r"); if (flog) { @@ -798,7 +798,7 @@ void CPWindow1::_EvOnCreate(CControl* control) { if (dup2(fileno(stdout), fileno(stderr)) == -1) { printf("PICSimLab: stderr redirect error [%i] %s \n", errno, strerror(errno)); } - + printf("PICSimLab: Console output redirected to file: \"%s\"\n", fname); #endif printf("PICSimLab: Version \"%s %s %s %s\"\n", _VERSION_, _DATE_, _ARCH_, _PKG_); @@ -914,14 +914,13 @@ void CPWindow1::_EvOnCreate(CControl* control) { if (ferror) { char btdir[256]; PICSimLab.SystemCmd(PSC_GETTEMPDIR, "PICSimLab", btdir); - std::string fbackup = std::string(btdir) + ""; fprintf(ferror, "\n\nPICSimLab: Error closing PICSimLab in last time! \nUsing default mode.\n Erro log file: %s\n " "If the problem persists, please consider opening an issue on github :\n" "https://github.com/lcgamboa/picsimlab/issues\n\n" "A backup was made of your project that presented a problem with the name following the template:\n" - "%s/backup__.pzw\n\n", + "%s/backup__.pzw\n\n", fname_error, btdir); fclose(ferror); }