diff --git a/porting/liteos_m/kernel/src/stdio/__stdio_read.c b/porting/liteos_m/kernel/src/stdio/__stdio_read.c index fcacffee46ecefb5729bbeacb85fd2402edbc389..60c9f7098b49c3bbd2b17fd6436518eab408068b 100644 --- a/porting/liteos_m/kernel/src/stdio/__stdio_read.c +++ b/porting/liteos_m/kernel/src/stdio/__stdio_read.c @@ -11,7 +11,7 @@ size_t __stdio_read(FILE *f, unsigned char *buf, size_t len) ssize_t cnt; cnt = read(f->fd, iov[0].iov_base, iov[0].iov_len); - if (iov[1].iov_len - iov[0].iov_len > 0) cnt += read(f->fd, iov[1].iov_base, iov[1].iov_len - iov[0].iov_len); + if (iov[1].iov_len > iov[0].iov_len) cnt += read(f->fd, iov[1].iov_base, iov[1].iov_len - iov[0].iov_len); if (cnt <= 0) { f->flags |= cnt ? F_ERR : F_EOF; return 0; @@ -22,4 +22,4 @@ size_t __stdio_read(FILE *f, unsigned char *buf, size_t len) f->rend = f->buf + cnt; if (f->buf_size) buf[len-1] = *f->rpos++; return len; -} \ No newline at end of file +}