From 449b547f2b6c51cdae9dbaff152266ca0bd339ea Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 1 Mar 2021 13:58:24 -0500 Subject: [PATCH] Use buffer.head() instead of casting --- src/zm_remote_camera_http.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 1a4da254e..98625aab8 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -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");