From 54219cbf2b2333d40f3c9c8d224a5a9f1fe33b11 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sun, 12 Jun 2022 19:36:18 +0200 Subject: [PATCH] sys/fs/constfs: allow to host arbitrary data Don't require all data to be a `uint8_t` array or to be casted into one. --- sys/fs/constfs/constfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/constfs/constfs.c b/sys/fs/constfs/constfs.c index 3152db1b4d9b..de4fab450deb 100644 --- a/sys/fs/constfs/constfs.c +++ b/sys/fs/constfs/constfs.c @@ -197,7 +197,7 @@ static ssize_t constfs_read(vfs_file_t *filp, void *dest, size_t nbytes) if (nbytes > (fp->size - filp->pos)) { nbytes = fp->size - filp->pos; } - memcpy(dest, fp->data + filp->pos, nbytes); + memcpy(dest, (const uint8_t *)fp->data + filp->pos, nbytes); DEBUG("constfs_read: read %lu bytes\n", (long unsigned)nbytes); filp->pos += nbytes; return nbytes;