make STRDUP and STRNDUP static

This commit is contained in:
CK Tan 2019-10-04 10:08:57 -07:00
parent bc951780ab
commit 63793f92ef

4
toml.c
View file

@ -58,7 +58,7 @@ void toml_set_memutil(void* (*xxmalloc)(size_t),
#define CALLOC(a,b) ppcalloc(a,b) #define CALLOC(a,b) ppcalloc(a,b)
#define REALLOC(a,b) pprealloc(a,b) #define REALLOC(a,b) pprealloc(a,b)
char* STRDUP(const char* s) static char* STRDUP(const char* s)
{ {
int len = strlen(s); int len = strlen(s);
char* p = MALLOC(len+1); char* p = MALLOC(len+1);
@ -69,7 +69,7 @@ char* STRDUP(const char* s)
return p; return p;
} }
char* STRNDUP(const char* s, size_t n) static char* STRNDUP(const char* s, size_t n)
{ {
size_t len = strnlen(s, n); size_t len = strnlen(s, n);
char* p = MALLOC(len+1); char* p = MALLOC(len+1);