mirror of
https://github.com/0intro/wmii
synced 2024-11-22 22:02:30 +03:00
16 lines
282 B
C
16 lines
282 B
C
/* Written by Kris Maglione <maglione.k at Gmail> */
|
|
/* Public domain */
|
|
#include <string.h>
|
|
#include "util.h"
|
|
|
|
char*
|
|
estrndup(const char *str, uint len) {
|
|
char *ret;
|
|
|
|
len = min(len, strlen(str));
|
|
ret = emalloc(len + 1);
|
|
memcpy(ret, str, len);
|
|
ret[len] = '\0';
|
|
return ret;
|
|
}
|