Use buffer.head() instead of casting

pull/3186/head
Isaac Connor 2021-03-01 13:58:24 -05:00
parent 05e7d76ccd
commit 449b547f2b
1 changed files with 3 additions and 3 deletions

View File

@ -629,7 +629,7 @@ int RemoteCameraHttp::GetResponse() {
bytes += buffer_len;
char *crlf = nullptr;
char *header_ptr = (char *)buffer;
char *header_ptr = buffer;
int header_len = buffer.size();
bool all_headers = false;
@ -1102,14 +1102,14 @@ int RemoteCameraHttp::Capture(ZMPacket &packet) {
image->Size(), content_length);
return -1;
}
image->Assign(width, height, colours, subpixelorder, buffer, imagesize);
image->Assign(width, height, colours, subpixelorder, buffer.head(), imagesize);
break;
case X_RGBZ :
if ( !image->Unzip( buffer.extract( content_length ), content_length ) ) {
Error("Unable to unzip RGB image");
return -1;
}
image->Assign(width, height, colours, subpixelorder, buffer, imagesize);
image->Assign(width, height, colours, subpixelorder, buffer.head(), imagesize);
break;
default :
Error("Unexpected image format encountered");