]> granicus.if.org Git - curl/commitdiff
schannel: fix comparisons between signed and unsigned
authorYang Tse <yangsita@gmail.com>
Thu, 14 Jun 2012 10:10:51 +0000 (12:10 +0200)
committerYang Tse <yangsita@gmail.com>
Thu, 14 Jun 2012 10:10:51 +0000 (12:10 +0200)
lib/curl_schannel.c

index 19c28dfa6ab25fb4edaa06529f8d4506ab52c7ed..1ddc220ae71bd3a6cbd3ea27b5cb870114d99916 100644 (file)
@@ -220,7 +220,7 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
   /* send initial handshake data which is now stored in output buffer */
   written = swrite(conn->sock[sockindex], outbuf.pvBuffer, outbuf.cbBuffer);
   s_pSecFn->FreeContextBuffer(outbuf.pvBuffer);
-  if(written != outbuf.cbBuffer) {
+  if(outbuf.cbBuffer != (size_t)written) {
     failf(data, "schannel: failed to send initial handshake data: %d\n",
           written);
     return CURLE_SSL_CONNECT_ERROR;
@@ -346,7 +346,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
         /* send handshake token to server */
         written = swrite(conn->sock[sockindex],
                          outbuf[i].pvBuffer, outbuf[i].cbBuffer);
-        if(written != outbuf[i].cbBuffer) {
+        if(outbuf[i].cbBuffer != (size_t)written) {
           failf(data, "schannel: failed to send next handshake data: %d\n",
                 written);
           return CURLE_SSL_CONNECT_ERROR;