#include "server/util.h" #include #include char* kqm_strndup(const char* str, size_t n) { char* s = (char*)malloc(n + 1); memcpy(s, str, n); s[n] = '\0'; return s; }