aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds/arm9/source/fat
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/ds/arm9/source/fat')
-rw-r--r--backends/platform/ds/arm9/source/fat/gba_nds_fat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c
index 76508a1664..1247b3f948 100644
--- a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c
+++ b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c
@@ -1460,7 +1460,7 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
{
// Match filename
found = true;
- for (namePos = 0; (namePos < MAX_FILENAME_LENGTH) && found && (name[namePos] != '\0') && (lfnName[namePos] != '\0'); namePos++)
+ for (namePos = 0; (namePos < MAX_FILENAME_LENGTH-1) && found && (name[namePos] != '\0') && (lfnName[namePos] != '\0'); namePos++)
{
if (name[namePos] != ucase(lfnName[namePos]))
{
@@ -1477,7 +1477,7 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
{
FAT_GetFilename(dirEntry, alias);
found = true;
- for (namePos = 0; (namePos < 13) && found && (name[namePos] != '\0') && (alias[namePos] != '\0'); namePos++)
+ for (namePos = 0; (namePos < (sizeof(alias)/sizeof(alias[0]))-1) && found && (name[namePos] != '\0') && (alias[namePos] != '\0'); namePos++)
{
if (name[namePos] != ucase(alias[namePos]))
{
@@ -3186,7 +3186,7 @@ int FAT_mkdir (const char* path)
// Create . directory entry
dirEntry.name[0] = '.';
// Fill name and extension with spaces
- for (i = 1; i < 11; i++)
+ for (i = 1; i < (sizeof(name)/sizeof(name[0])); i++)
{
dirEntry.name[i] = ' ';
}