1 // SPDX-License-Identifier: BSD-2-Clause 2 /* 3 * Copyright (c) 2018 EPAM Systems 4 */ 5 #include <stdlib.h> 6 #include <string.h> 7 #include <string_ext.h> 8 nex_strdup(const char * s)9char *nex_strdup(const char *s) 10 { 11 size_t l = strlen(s) + 1; 12 char *p = nex_malloc(l); 13 14 if (p) 15 memcpy(p, s, l); 16 return p; 17 } 18