math/src/server/util.c

14 lines
207 B
C

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