Commit e8c07bf4 authored by Chip Turner's avatar Chip Turner Committed by facebook-github-bot-9

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
parent ae59a5e9
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment