Created
November 29, 2012 17:11
-
-
Save guyzmo/4170462 to your computer and use it in GitHub Desktop.
Patch for strnlen support in freevpn (for OSX 10.6)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/platform/io.c b/platform/io.c | |
index 209666a..0a6c2cf 100644 | |
--- a/platform/io.c | |
+++ b/platform/io.c | |
@@ -24,6 +24,16 @@ | |
#if defined(__FreeBSD__) | |
#define IO_BSD | |
#elif defined(__APPLE__) | |
+size_t strnlen(const char *s, size_t maxlen) | |
+{ | |
+ size_t len; | |
+ | |
+ for (len = 0; len < maxlen; len++, s++) { | |
+ if (!*s) | |
+ break; | |
+ } | |
+ return (len); | |
+} | |
#define IO_BSD | |
#define IO_USE_SELECT | |
#elif defined(WIN32) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment