quiten build error

This commit is contained in:
Isaac Connor 2018-04-23 14:43:16 -04:00
parent c0d04521d4
commit e8eaf5fc80
1 changed files with 5 additions and 4 deletions

View File

@ -187,13 +187,14 @@ int RemoteCameraNVSocket::Capture( Image &image ) {
Warning( "Unable to capture image, retrying" );
return 0;
}
if ( Read( sd, buffer, imagesize ) < imagesize ) {
Warning( "Unable to capture image, retrying" );
int bytes_read = Read(sd, buffer, imagesize);
if ( (bytes_read < 0) || ( (unsigned int)bytes_read < imagesize ) ) {
Warning("Unable to capture image, retrying");
return 0;
}
uint32_t end;
if ( Read(sd, (char *) &end , sizeof(end)) < 0 ) {
Warning( "Unable to capture image, retrying" );
Warning("Unable to capture image, retrying");
return 0;
}
if ( end != 0xFFFFFFFF) {
@ -201,7 +202,7 @@ int RemoteCameraNVSocket::Capture( Image &image ) {
return 0;
}
image.Assign( width, height, colours, subpixelorder, buffer, imagesize );
image.Assign(width, height, colours, subpixelorder, buffer, imagesize);
return 1;
}