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
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m46s
This commit is contained in:
@@ -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)"
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user