diff options
Diffstat (limited to 'src/libstrongswan/utils/windows.c')
-rw-r--r-- | src/libstrongswan/utils/windows.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/windows.c b/src/libstrongswan/utils/windows.c index feefcd497..48a70b6c2 100644 --- a/src/libstrongswan/utils/windows.c +++ b/src/libstrongswan/utils/windows.c @@ -49,6 +49,21 @@ int usleep(useconds_t usec) return 0; } +/** + * See header. + */ +char* strndup(const char *s, size_t n) +{ + char *dst; + + n = min(strnlen(s, n), n); + dst = malloc(n + 1); + memcpy(dst, s, n); + dst[n] = '\0'; + + return dst; +} + /* * See header. */ |