#include #include char *kf_strdup(char *str) { size_t n = strlen(str); char *s = malloc(n + 1); strcpy(s, str); s[n] = '\0'; return s; }