Fix GCC warning, snprintf limit too long (#623)

- One snprintf in arm9/source/godmode.c call had a limit that was past
   the size of the datestr variable it was writing into. Fixed to match
   the size of the variable.
This commit is contained in:
Gabriel Marcano 2020-08-24 19:42:56 -07:00 committed by GitHub
parent 1f2514f19e
commit d682a65df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -964,7 +964,7 @@ u32 DirFileAttrMenu(const char* path, const char *name) {
if (fvx_stat(path, &fno) != FR_OK) return 1;
vrt = (fno.fattrib & AM_VRT);
new_attrib = fno.fattrib;
snprintf(datestr, 64, "%s: %04d-%02d-%02d %02d:%02d:%02d\n",
snprintf(datestr, 32, "%s: %04d-%02d-%02d %02d:%02d:%02d\n",
(fno.fattrib & AM_DIR) ? "created" : "modified",
1980 + ((fno.fdate >> 9) & 0x7F), (fno.fdate >> 5) & 0xF, fno.fdate & 0x1F,
(fno.ftime >> 11) & 0x1F, (fno.ftime >> 5) & 0x3F, (fno.ftime & 0x1F) << 1);