Browse Source

Fixed warning

yhirose 5 years ago
parent
commit
38a6b3e69f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      httplib.h

+ 3 - 3
httplib.h

@@ -4551,11 +4551,11 @@ public:
 private:
 private:
   static void locking_callback(int mode, int type, const char * /*file*/,
   static void locking_callback(int mode, int type, const char * /*file*/,
                                int /*line*/) {
                                int /*line*/) {
-    auto &locks = *openSSL_locks_;
+    auto &lk = (*openSSL_locks_)[static_cast<size_t>(type)];
     if (mode & CRYPTO_LOCK) {
     if (mode & CRYPTO_LOCK) {
-      locks[type].lock();
+      lk.lock();
     } else {
     } else {
-      locks[type].unlock();
+      lk.unlock();
     }
     }
   }
   }
 };
 };