Skip to content

Commit

Permalink
sys/fs/constfs: allow to host arbitrary data
Browse files Browse the repository at this point in the history
Don't require all data to be a `uint8_t` array or to be casted into one.
  • Loading branch information
benpicco committed Jun 12, 2022
1 parent d797b74 commit 54219cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/fs/constfs/constfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 54219cb

Please sign in to comment.