summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/https-client.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sample/https-client.c b/sample/https-client.c
index 85433850..f7490cdb 100644
--- a/sample/https-client.c
+++ b/sample/https-client.c
@@ -247,6 +247,17 @@ add_cert_for_store(X509_STORE *store, const char *name)
}
#endif
+#if defined(_WIN32) && !defined(__MINGW32__)
+char* strndup(const char* src, size_t chars) {
+ char* buffer = (char*) malloc(chars + 1);
+ if (buffer) {
+ strncpy(buffer, src, chars);
+ buffer[chars] = '\0';
+ }
+ return buffer;
+}
+#endif
+
int
main(int argc, char **argv)
{