diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f9db790f..2f4768c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,13 +12,12 @@ SET(CMAKE_POSITION_INDEPENDENT_CODE ON) IF (UNIX) SET (D3_GAMEDIR "~/Descent3/") - IF (APPLE) - SET(EXTRA_CXX_FLAGS "-Wno-address-of-temporary") - ELSE() - SET(EXTRA_CXX_FLAGS "-fpermissive") + + IF (UNIX AND NOT APPLE) + SET(EXTRA_CXX_FLAGS "-fpermissive ") ENDIF() - STRING(APPEND CMAKE_CXX_FLAGS " -Wno-write-strings -Wno-multichar ${BITS} ${EXTRA_CXX_FLAGS}") + STRING(APPEND CMAKE_CXX_FLAGS " -Wno-write-strings -Wno-multichar -Wno-address-of-temporary ${BITS} ${EXTRA_CXX_FLAGS}") STRING(APPEND CMAKE_C_FLAGS " ${BITS}") FIND_PACKAGE(SDL REQUIRED) diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index d595519c0..30b9a43d3 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -199,7 +199,7 @@ void UIEdit::SetText(char *text) { void UIEdit::GetText(char *buffer, int len) { // ASSERT(strlen(m_TextBuf) < (unsigned)len); if (!m_TextBuf) { - buffer[0] = NULL; + buffer[0] = 0; return; } strncpy(buffer, m_TextBuf, len - 1);