sdutil FAT formatting, libfat fix memcpy overflow, generate linker .map files for user apps
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m46s

This commit is contained in:
2026-03-21 00:08:19 +01:00
parent 7fa37ad6d7
commit 3a48856ee4
11 changed files with 41 additions and 34 deletions

View File

@@ -2,6 +2,7 @@ include ../make/ufuncs.mk
$(eval $(call add_include,libsystem))
$(eval $(call add_include,libstring))
$(eval $(call add_include,libaux))
cflags += -D"FAT_PRINTF(a)"

View File

@@ -1,6 +1,7 @@
#include <devices.h>
#include <fs_types.h>
#include <libfat.h>
#include <minmax.h>
#include <status.h>
#include <stddef.h>
#include <stdint.h>
@@ -69,7 +70,7 @@ static int fat_diskio_write (struct fatfs_ctx* ctx, uint32_t sector, uint8_t* bu
int fat_format_drive (struct fatfs_ctx* ctx, const char* device_key, int fs_type) {
memset (ctx, 0, sizeof (*ctx));
memcpy (ctx->device_name, device_key, sizeof (ctx->device_name) - 1);
memcpy (ctx->device_name, device_key, min (sizeof (ctx->device_name) - 1, strlen (device_key)));
size_t total_size = 0;
device_do (device_key, XDRV_GET_SIZE, &total_size, NULL, NULL, NULL);