Skip to content

Commit

Permalink
Fix GCC warning, snprintf limit too long (d0k3#623)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
gemarcano authored Aug 25, 2020
1 parent 1f2514f commit d682a65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arm9/source/godmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d682a65

Please sign in to comment.