From fe16aedd32137828fb0ab9cdd68ef043e17c59ee Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 15 May 2020 13:05:51 +0200 Subject: Fix build issue: strlcpy & strlcat are BSD specific --- libversion/fullversion.cpp | 8 ++++---- libversion/gitversion.cpp.in | 4 ++-- src/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libversion/fullversion.cpp b/libversion/fullversion.cpp index dfc2b0d..e0a779f 100644 --- a/libversion/fullversion.cpp +++ b/libversion/fullversion.cpp @@ -8,12 +8,12 @@ const char *getFullVersion(void) static bool init = false; if (!init) { - strlcpy(fullVersionString,getDoxygenVersion(),BUF_SIZE); + strncpy(fullVersionString,getDoxygenVersion(),BUF_SIZE-1); if (strlen(getGitVersion())>0) { - strlcat(fullVersionString," (",BUF_SIZE); - strlcat(fullVersionString,getGitVersion(),BUF_SIZE); - strlcat(fullVersionString,")",BUF_SIZE); + strncat(fullVersionString," (",BUF_SIZE-1); + strncat(fullVersionString,getGitVersion(),BUF_SIZE-1); + strncat(fullVersionString,")",BUF_SIZE-1); } fullVersionString[BUF_SIZE-1]='\0'; init = true; diff --git a/libversion/gitversion.cpp.in b/libversion/gitversion.cpp.in index 50ce1d2..242dd59 100644 --- a/libversion/gitversion.cpp.in +++ b/libversion/gitversion.cpp.in @@ -13,8 +13,8 @@ const char *getGitVersion(void) static bool init = false; if (!init) { - strncpy(gitVersionString,"@GIT_HEAD_SHA1@",BUF_SIZE); - strncat(gitVersionString,!strcmp("@GIT_IS_DIRTY@","true")?"*":"",BUF_SIZE); + strncpy(gitVersionString,"@GIT_HEAD_SHA1@",BUF_SIZE-1); + strncat(gitVersionString,!strcmp("@GIT_IS_DIRTY@","true")?"*":"",BUF_SIZE-1); if (!strcmp("@GIT_HEAD_SHA1@", "GIT-NOTFOUND")) gitVersionString[0] = '\0'; gitVersionString[BUF_SIZE-1]='\0'; init = true; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 154abb0..fec251e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -315,8 +315,8 @@ if (use_libclang) endif() target_link_libraries(doxygen - doxycfg doxymain + doxycfg qtools md5 lodepng -- cgit v0.12