From f5fa98c7258b6d04a29b4aa479a089b84a59a6aa Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Sun, 1 Aug 2021 19:19:52 +0200 Subject: [PATCH] possibly fix script EOF endings? --- source/storage/nx_sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/storage/nx_sd.c b/source/storage/nx_sd.c index 8e4eb56..f122380 100644 --- a/source/storage/nx_sd.c +++ b/source/storage/nx_sd.c @@ -194,7 +194,8 @@ void *sd_file_read(const char *path, u32 *fsize) if (fsize) *fsize = size; - void *buf = malloc(size); + char *buf = malloc(size + 1); + buf[size] = '\0'; if (f_read(&fp, buf, size, NULL) != FR_OK) {