Merging changes from AeroXuk/libpostal_windows.

This commit is contained in:
AeroXuk
2017-11-19 12:44:38 +00:00
parent 7d6e648fc3
commit 2d3b420d35
17 changed files with 398 additions and 30 deletions

16
src/strndup.c Normal file
View File

@@ -0,0 +1,16 @@
#ifndef HAVE_STRNDUP
#include <stdlib.h>
#include <string.h>
char *strndup(const char *s, size_t n)
{
char* new = malloc(n+1);
if (new) {
strncpy(new, s, n);
new[n] = '\0';
}
return new;
}
#endif /* HAVE_STRNDUP */