Avoid signed and unsigned comparison
This commit is contained in:
parent
f9b42b4079
commit
181d3ad64a
@ -72,13 +72,13 @@ size_t File::get_size()
|
||||
*/
|
||||
bool File::read(uint8_t * buf, size_t size)
|
||||
{
|
||||
off_t n_bytes_read = 0u;
|
||||
size_t n_bytes_read = 0u;
|
||||
for (;;)
|
||||
{
|
||||
off_t rd_size = ::read(m_fd, &buf[n_bytes_read], size - n_bytes_read);
|
||||
if (rd_size <= 0)
|
||||
break;
|
||||
n_bytes_read += rd_size;
|
||||
n_bytes_read += (size_t)rd_size;
|
||||
if (n_bytes_read >= size)
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user