diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-22 11:18:19 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-22 11:18:19 -0400 |
commit | 90a09df5ba7b3e55ea388a4cc9b92161442bb380 (patch) | |
tree | 1e50692d10ede2ddcf2c8b271a9c086c0a7d189e /src/common/compat.h | |
parent | bfb39164ce49450fad11611a129dd875acebde54 (diff) | |
download | tor-90a09df5ba7b3e55ea388a4cc9b92161442bb380.tar.gz tor-90a09df5ba7b3e55ea388a4cc9b92161442bb380.zip |
Extract strlcpy and strlcmp to libtor-string
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 21fd0211a3..605438cc62 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -48,6 +48,7 @@ #include "lib/cc/compat_compiler.h" #include "common/compat_time.h" #include "lib/string/compat_ctype.h" +#include "lib/string/compat_string.h" #include "lib/string/printf.h" #include <stdio.h> @@ -55,31 +56,6 @@ /* ===== Compiler compatibility */ -/* ===== String compatibility */ -#ifdef _WIN32 -/* Windows names string functions differently from most other platforms. */ -#define strncasecmp _strnicmp -#define strcasecmp _stricmp -#endif - -#if defined __APPLE__ -/* On OSX 10.9 and later, the overlap-checking code for strlcat would - * appear to have a severe bug that can sometimes cause aborts in Tor. - * Instead, use the non-checking variants. This is sad. - * - * See https://trac.torproject.org/projects/tor/ticket/15205 - */ -#undef strlcat -#undef strlcpy -#endif /* defined __APPLE__ */ - -#ifndef HAVE_STRLCAT -size_t strlcat(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2)); -#endif -#ifndef HAVE_STRLCPY -size_t strlcpy(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2)); -#endif - /** Represents an mmaped file. Allocated via tor_mmap_file; freed with * tor_munmap_file. */ typedef struct tor_mmap_t { |