Small fix for WIN32
This commit is contained in:
parent
95ee4414f6
commit
624013252b
2
toml.c
2
toml.c
|
@ -37,7 +37,7 @@ SOFTWARE.
|
||||||
char* strndup(const char* s, size_t n)
|
char* strndup(const char* s, size_t n)
|
||||||
{
|
{
|
||||||
size_t len = strnlen(s, n);
|
size_t len = strnlen(s, n);
|
||||||
char* p = malloc(s, len+1);
|
char* p = malloc(len+1);
|
||||||
if (p) {
|
if (p) {
|
||||||
memcpy(p, s, len);
|
memcpy(p, s, len);
|
||||||
p[len] = 0;
|
p[len] = 0;
|
||||||
|
|
Loading…
Reference in New Issue