summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/imgtool/modules/fat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/imgtool/modules/fat.cpp')
-rw-r--r--src/tools/imgtool/modules/fat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/imgtool/modules/fat.cpp b/src/tools/imgtool/modules/fat.cpp
index 68110275e07..dba4b7cc03e 100644
--- a/src/tools/imgtool/modules/fat.cpp
+++ b/src/tools/imgtool/modules/fat.cpp
@@ -1326,11 +1326,11 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil
lfn_checksum = entry[13];
}
lfn_lastentry = entry[0] & 0x3F;
- prepend_lfn_bytes(lfn_buf, ARRAY_LENGTH(lfn_buf),
+ prepend_lfn_bytes(lfn_buf, std::size(lfn_buf),
&lfn_len, entry, 28, 2);
- prepend_lfn_bytes(lfn_buf, ARRAY_LENGTH(lfn_buf),
+ prepend_lfn_bytes(lfn_buf, std::size(lfn_buf),
&lfn_len, entry, 14, 6);
- prepend_lfn_bytes(lfn_buf, ARRAY_LENGTH(lfn_buf),
+ prepend_lfn_bytes(lfn_buf, std::size(lfn_buf),
&lfn_len, entry, 1, 5);
}
else if (freeent && (freeent->position == ~0))
@@ -1372,8 +1372,8 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil
j = 0;
do
{
- i += uchar_from_utf16(&ch, &lfn_buf[i], ARRAY_LENGTH(lfn_buf) - i);
- j += utf8_from_uchar(&ent.long_filename[j], ARRAY_LENGTH(ent.long_filename) - j, ch);
+ i += uchar_from_utf16(&ch, &lfn_buf[i], std::size(lfn_buf) - i);
+ j += utf8_from_uchar(&ent.long_filename[j], std::size(ent.long_filename) - j, ch);
}
while(ch != 0);
}
@@ -1834,7 +1834,7 @@ static imgtoolerr_t fat_partition_nextenum(imgtool::directory &enumeration, imgt
return err;
/* copy stuff from the FAT dirent to the Imgtool dirent */
- snprintf(ent.filename, ARRAY_LENGTH(ent.filename), "%s", fatent.long_filename[0]
+ snprintf(ent.filename, std::size(ent.filename), "%s", fatent.long_filename[0]
? fatent.long_filename : fatent.short_filename);
ent.filesize = fatent.filesize;
ent.directory = fatent.directory;