Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/emubd
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2017-03-26 03:10:21 +0300
committerChristopher Haster <chaster@utexas.edu>2017-03-26 03:23:30 +0300
commit8a95fdfdfdb6468a108cd31bea5e6813a86272cd (patch)
treeb27dba4ce9b56d3d3bfd6685ff371bf1e62ade67 /emubd
parenta711675607496eb6271c22de9239f334639980e3 (diff)
Added file read/write tests and some framework updates
Diffstat (limited to 'emubd')
-rw-r--r--emubd/lfs_emubd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/emubd/lfs_emubd.c b/emubd/lfs_emubd.c
index 794f25f..b24cb0a 100644
--- a/emubd/lfs_emubd.c
+++ b/emubd/lfs_emubd.c
@@ -88,7 +88,7 @@ int lfs_emubd_read(lfs_emubd_t *emu, lfs_block_t block,
// Iterate over blocks until enough data is read
while (size > 0) {
- snprintf(emu->child, LFS_NAME_MAX, "%d", block);
+ snprintf(emu->child, LFS_NAME_MAX, "%x", block);
size_t count = lfs_min(emu->info.erase_size - off, size);
FILE *f = fopen(emu->path, "rb");
@@ -137,7 +137,7 @@ int lfs_emubd_prog(lfs_emubd_t *emu, lfs_block_t block,
// Iterate over blocks until enough data is read
while (size > 0) {
- snprintf(emu->child, LFS_NAME_MAX, "%d", block);
+ snprintf(emu->child, LFS_NAME_MAX, "%x", block);
size_t count = lfs_min(emu->info.erase_size - off, size);
FILE *f = fopen(emu->path, "r+b");
@@ -186,7 +186,7 @@ int lfs_emubd_erase(lfs_emubd_t *emu, lfs_block_t block,
// Iterate and erase blocks
while (size > 0) {
- snprintf(emu->child, LFS_NAME_MAX, "%d", block);
+ snprintf(emu->child, LFS_NAME_MAX, "%x", block);
struct stat st;
int err = stat(emu->path, &st);
if (err && errno != ENOENT) {