Skip to content

Commit

Permalink
stdio/file: fix write_buffer()
Browse files Browse the repository at this point in the history
JIRA: RTOS-892
  • Loading branch information
ziemleszcz committed Nov 7, 2024
1 parent 61f9d17 commit 88333ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stdio/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,10 @@ static inline ssize_t write_buffer(FILE *stream, size_t writesz)
if (err < writesz) {
/* EAGAIN */
stream->flags |= F_ERROR;
}

if (err > 0) {
memmove(stream->buffer, stream->buffer + err, stream->bufpos);
}
if (err > 0 && stream->bufpos > 0) {
memmove(stream->buffer, stream->buffer + err, stream->bufpos);
}
}
else {
Expand Down

0 comments on commit 88333ea

Please sign in to comment.