diff --git a/source/arm9/firm.c b/source/arm9/firm.c index 712f6cd..905b77b 100644 --- a/source/arm9/firm.c +++ b/source/arm9/firm.c @@ -180,7 +180,7 @@ continue; if(printInfo) - uiPrintInfo("Section %" PRIu32 ":\n offset: 0x%" PRIX32 "\n addr: 0x%" PRIX32 "\n size: 0x%" PRIX32 "\n", + uiPrintInfo("Section %" PRIu32 ":\n Offset: 0x%" PRIX32 "\n Addr: 0x%" PRIX32 "\n Size: 0x%" PRIX32 "\n", i, section->offset, section->address, section->size); if(section->offset >= fwSize || section->offset < sizeof(firm_header)) @@ -234,7 +234,7 @@ isValid = memcmp(hash, section->hash, 32) == 0; if(printInfo) - uiPrintInfo("Hash: %s\x1B[0m\n", res[isValid]); + uiPrintInfo(" Hash: %s\x1B[0m\n", res[isValid]); retval &= isValid; } diff --git a/source/arm9/ui.c b/source/arm9/ui.c index 802352b..762cea1 100644 --- a/source/arm9/ui.c +++ b/source/arm9/ui.c @@ -137,15 +137,16 @@ void uiPrint(const char *const format, unsigned int color, bool centered, ...) { const unsigned int width = (unsigned int)consoleGet()->consoleWidth; - char tmp[width + 1]; + char tmp[256]; va_list args; va_start(args, centered); - vsnprintf(tmp, width + 1, format, args); + vsnprintf(tmp, 556, format, args); va_end(args); if(centered) { + // Warning. The string must be <= the console width here! size_t len = strlen(tmp); printf("\x1B[%um%*s%s\x1B[0m", color, (width - len) / 2, "", tmp); }