Skip to content
Snippets Groups Projects
Commit fb15bacc authored by jwindley's avatar jwindley
Browse files

Add EOF check

parent 94f91c62
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,7 @@ courier_t::read_bytes( char *buf, const size_t size )
ptr = buf;
while ( bytes_remaining > 0 ) {
bytes_read = read( m_fd, ptr, bytes_remaining );
if ( bytes_read == 0 ) return 0;
if ( bytes_read < 0 ) return 0;
bytes_remaining -= bytes_read;
ptr += bytes_read;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment