[Wine-patches] [eter-2.1 5/9] winhttp: Avoid signed-unsigned integer comparisons. (eterbug #10937).

Dmitry Timoshkov dmitry на baikal.ru
Пн Дек 14 10:33:36 MSK 2015


From: Hans Leidekker <hans на codeweavers.com>
---
 dlls/winhttp/net.c     | 2 +-
 dlls/winhttp/request.c | 4 ++--
 dlls/winhttp/session.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
index fa8cad0..5ce7683 100644
--- a/dlls/winhttp/net.c
+++ b/dlls/winhttp/net.c
@@ -568,7 +568,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T *
     SecBuffer bufs[4];
     SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs};
     SSIZE_T size, buf_len;
-    int i;
+    unsigned int i;
     SECURITY_STATUS res;
 
     assert(conn->extra_len < ssl_buf_size);
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index f53c70f..3792085 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -2980,9 +2980,9 @@ static HRESULT request_send( struct winhttp_request *request )
         VariantInit( &data );
         if (V_VT( &request->data ) == VT_BSTR)
         {
-            UINT i, cp = CP_ACP;
+            UINT cp = CP_ACP;
             const WCHAR *str = V_BSTR( &request->data );
-            int len = strlenW( str );
+            int i, len = strlenW( str );
 
             for (i = 0; i < len; i++)
             {
diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index 41b266a..d43b225 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -878,7 +878,7 @@ static const object_vtbl_t request_vtbl =
 static BOOL store_accept_types( request_t *request, const WCHAR **accept_types )
 {
     const WCHAR **types = accept_types;
-    int i;
+    DWORD i;
 
     if (!types) return TRUE;
     while (*types)
@@ -897,7 +897,7 @@ static BOOL store_accept_types( request_t *request, const WCHAR **accept_types )
     {
         if (!(request->accept_types[i] = strdupW( *types )))
         {
-            for (; i >= 0; i--) heap_free( request->accept_types[i] );
+            for ( ; i > 0; --i) heap_free( request->accept_types[i - 1] );
             heap_free( request->accept_types );
             request->accept_types = NULL;
             request->num_accept_types = 0;
-- 
2.6.4



Подробная информация о списке рассылки Wine-patches