]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
windows: fix comparison of mismatched types warning
authorViktor Szakats <commit@vsz.me>
Mon, 12 Oct 2020 10:18:53 +0000 (10:18 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 12 Oct 2020 10:18:53 +0000 (10:18 +0000)
clang 10, mingw-w64:
```
vtls/openssl.c:2917:33: warning: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long')
      [-Wsign-compare]
              if(GetLastError() != CRYPT_E_NOT_FOUND)
                 ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
```

Approved-by: Daniel Stenberg
Closes #6062

lib/vtls/openssl.c

index ffc0d66668760663c43df65ed9798328f160158e..28a1ae6dab6c1873cdb0ab5c79d77da18274fc41 100644 (file)
@@ -2914,7 +2914,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
               /* "If GetLastError returns CRYPT_E_NOT_FOUND, the certificate is
                  good for all uses. If it returns zero, the certificate has no
                  valid uses." */
-              if(GetLastError() != CRYPT_E_NOT_FOUND)
+              if((HRESULT)GetLastError() != CRYPT_E_NOT_FOUND)
                 continue;
             }
             else {