| #include <crm_internal.h> |
| #include <stdlib.h> |
| #include <string.h> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| char * |
| strndup(const char *str, size_t len) |
| { |
| size_t n = strnlen(str, len); |
| char *new = (char *)malloc(len + 1); |
| |
| if (NULL == new) { |
| return NULL; |
| } |
| |
| new[n] = '\0'; |
| return (char *)memcpy(new, str, len); |
| } |