diff options
| author | 2021-12-23 03:23:37 +0100 | |
|---|---|---|
| committer | 2021-12-23 03:23:37 +0100 | |
| commit | 6d7fc8add220885a8f5886bf76390bdb737ffbd9 (patch) | |
| tree | 0bdafab9971cd9dcbfb599f1ba546f0f7fb37b54 /src | |
| parent | 429cbc660ae14d4998715803b44c71abf0e4a339 (diff) | |
| download | libplist-6d7fc8add220885a8f5886bf76390bdb737ffbd9.tar.gz libplist-6d7fc8add220885a8f5886bf76390bdb737ffbd9.tar.bz2 | |
jplist: Fix build on Windows
Diffstat (limited to 'src')
| -rw-r--r-- | src/jplist.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/jplist.c b/src/jplist.c index 08441c0..218d75a 100644 --- a/src/jplist.c +++ b/src/jplist.c | |||
| @@ -65,6 +65,18 @@ void plist_json_deinit(void) | |||
| 65 | /* deinit JSON stuff */ | 65 | /* deinit JSON stuff */ |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | #ifndef HAVE_STRNDUP | ||
| 69 | static char* strndup(char* str, size_t len) | ||
| 70 | { | ||
| 71 | char *newstr = (char *)malloc(len+1); | ||
| 72 | if (newstr) { | ||
| 73 | strncpy(newstr, str, len); | ||
| 74 | newstr[len]= '\0'; | ||
| 75 | } | ||
| 76 | return newstr; | ||
| 77 | } | ||
| 78 | #endif | ||
| 79 | |||
| 68 | static size_t dtostr(char *buf, size_t bufsize, double realval) | 80 | static size_t dtostr(char *buf, size_t bufsize, double realval) |
| 69 | { | 81 | { |
| 70 | size_t len = 0; | 82 | size_t len = 0; |
