cmod: 3dstocmod: Create logger

Without creating a logger, the command dies with SEGFAULT when
Read3DSFile(std::istream&) tries to print the verbose message.

    GetLogger()->verbose("3DS file, {} bytes\n", chunkSize + 6);

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
pull/1340/head
Yasushi SHOJI 2022-01-25 19:55:33 +09:00 committed by Hleb Valoshka
parent 3a218976bf
commit 3702250525
1 changed files with 4 additions and 0 deletions

View File

@ -15,11 +15,13 @@
#include <cel3ds/3dsread.h>
#include <celmath/mathlib.h>
#include <celutil/logger.h>
#include "cmodops.h"
#include "convert3ds.h"
#include "pathmanager.h"
using celestia::util::CreateLogger;
void usage()
{
@ -35,6 +37,8 @@ int main(int argc, char* argv[])
return 1;
}
CreateLogger();
std::string inputFileName = argv[1];
std::cerr << "Reading...\n";