From b4d4ce77b21162174765a5c2c069902ff1c0b853 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Mon, 29 Aug 2022 21:02:36 +0200 Subject: [PATCH] tools/dumpnbt: better variable name and exit when data is invalid --- src/tools/dumpnbt.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/dumpnbt.cpp b/src/tools/dumpnbt.cpp index 34a445c..d28f098 100644 --- a/src/tools/dumpnbt.cpp +++ b/src/tools/dumpnbt.cpp @@ -86,12 +86,15 @@ int main(int argc, char* argv[]) { } fileStream.close(); - bool validData = NBT::validateRawNBTData(data, fileSize); - if (validData) { + bool isValidData = NBT::validateRawNBTData(data, fileSize); + if (isValidData) { std::cerr << "Valid data." << std::endl; } else { std::cerr << "Invalid data." << std::endl; + return EXIT_RUNTIME; } + //TODO: print things here + return EXIT_SUCCESS; }