From 9f98d623506e7b7a86561152807526aeb2bb5be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 20 Dec 2014 19:10:44 +0000 Subject: Omegle: Various code improvements (as reported by Coverity analyser); version bump This also fixes no locking of EventsLoop (and eventually related issues) git-svn-id: http://svn.miranda-ng.org/main/trunk@11545 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Omegle/src/communication.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/Omegle/src/communication.cpp') diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index fb2641a88b..eba4f12aca 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -136,10 +136,10 @@ bool Omegle_client::handle_error(const std::string &method, bool force_disconnec std::string Omegle_client::get_server( bool not_last ) { - BYTE q = not_last ? 1 : 0; + int q = not_last ? 1 : 0; int server = db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_SERVER, 0); - if (server < 0 || server >= (SIZEOF(servers)-q)) + if (server < 0 || server >= (int)(SIZEOF(servers)-q)) server = 0; if (server == 0) { @@ -286,6 +286,7 @@ NETLIBHTTPHEADER* Omegle_client::get_request_headers( int request_type, int* hea case OMEGLE_REQUEST_RECAPTCHA: headers[3].szName = "Content-Type"; headers[3].szValue = "application/x-www-form-urlencoded; charset=utf-8"; + // intentionally no break; case OMEGLE_REQUEST_HOME: case OMEGLE_REQUEST_COUNT: @@ -304,7 +305,7 @@ NETLIBHTTPHEADER* Omegle_client::get_request_headers( int request_type, int* hea void Omegle_client::store_headers( http::response* resp, NETLIBHTTPHEADER* headers, int headersCount ) { - for ( size_t i = 0; i < headersCount; i++ ) + for ( size_t i = 0; i < (size_t)headersCount; i++ ) { std::string header_name = headers[i].szName; std::string header_value = headers[i].szValue; -- cgit v1.2.3