From 88f2bc6b630194b8c688ea579337039f78c30abb Mon Sep 17 00:00:00 2001 From: Kfir Itzhak Date: Sun, 24 Nov 2013 15:37:47 +0200 Subject: [PATCH] Fix zmc crashing on shutdown (for remote http cameras) caused by content_length sign mess --- 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 deae375db..07d0e6a41 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -441,7 +441,7 @@ int RemoteCameraHttp::GetResponse() if ( content_length ) { - while ( buffer.size() < (unsigned int)content_length ) + while ( (long)buffer.size() < content_length ) { int buffer_len = ReadData( buffer ); if ( buffer_len == 0 ) @@ -973,7 +973,7 @@ int RemoteCameraHttp::GetResponse() if ( content_length ) { - while ( buffer.size() < (unsigned int)content_length ) + while ( (long)buffer.size() < content_length ) { //int buffer_len = ReadData( buffer, content_length-buffer.size() ); int buffer_len = ReadData( buffer ); @@ -1125,7 +1125,7 @@ int RemoteCameraHttp::Capture( Image &image ) } case X_RGB : { - if ( (unsigned int)content_length != image.Size() ) + if ( content_length != (long)image.Size() ) { Error( "Image length mismatch, expected %d bytes, content length was %d", image.Size(), content_length ); Disconnect();