From e8c07bf4d7268902625b77e55a11d61bb4a2205e Mon Sep 17 00:00:00 2001 From: Chip Turner Date: Mon, 21 Sep 2015 15:58:03 -0700 Subject: [PATCH] Move definition of strlcpy to outside an #if Summary: Looks like some platforms fail to build (open source, not internal) due to #if conditional. Reviewed By: @ldemailly Differential Revision: D2464555 --- folly/Demangle.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/folly/Demangle.cpp b/folly/Demangle.cpp index 54b46d27..47f151e2 100644 --- a/folly/Demangle.cpp +++ b/folly/Demangle.cpp @@ -91,16 +91,6 @@ void demangleCallback(const char* str, size_t size, void* p) { } // namespace -size_t strlcpy(char* dest, const char* const src, size_t size) { - size_t len = strlen(src); - if (size != 0) { - size_t n = std::min(len, size - 1); // always null terminate! - memcpy(dest, src, n); - dest[n] = '\0'; - } - return len; -} - size_t demangle(const char* name, char* out, size_t outSize) { DemangleBuf dbuf; dbuf.dest = out; @@ -134,4 +124,14 @@ size_t demangle(const char* name, char* out, size_t outSize) { #endif +size_t strlcpy(char* dest, const char* const src, size_t size) { + size_t len = strlen(src); + if (size != 0) { + size_t n = std::min(len, size - 1); // always null terminate! + memcpy(dest, src, n); + dest[n] = '\0'; + } + return len; +} + } // folly -- 2.34.1