mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Trailing zeros in file leading to unexpected file length get set in destination buffer
This commit is contained in:
parent
37f0931c02
commit
7ba5b0d150
@ -1098,8 +1098,8 @@ cfs_read(int fd, void *buf, unsigned size)
|
||||
|
||||
fdp = &coffee_fd_set[fd];
|
||||
file = fdp->file;
|
||||
if(fdp->offset + size > file->end) {
|
||||
size = file->end - fdp->offset;
|
||||
while(fdp->offset + size > file->end) {
|
||||
((char*)buf)[--size] = 0;
|
||||
}
|
||||
|
||||
/* If the file is not modified, read directly from the file extent. */
|
||||
|
Loading…
Reference in New Issue
Block a user