Sfoglia il codice sorgente

Fix usage of strcpy_s on Linux systems

Patrick-Christopher Mattulat 1 anno fa
parent
commit
66293521c4
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      source/ls-std/core/exception/ExceptionMessage.cpp

+ 5 - 0
source/ls-std/core/exception/ExceptionMessage.cpp

@@ -27,7 +27,12 @@ char *ExceptionMessage::toCharacterPointer()
   {
     size_t initializationSize = this->message.size() + 1;
     rawPointerMessage = new char[initializationSize];
+#if defined(unix) || defined(__APPLE__)
+    strcpy(rawPointerMessage, this->message.c_str());
+#endif
+#ifdef _WIN32
     strcpy_s(rawPointerMessage, initializationSize, this->message.c_str());
+#endif
     rawPointerMessage[this->message.size()] = '\0';
   }