mirror of
https://github.com/0intro/wmii
synced 2024-11-25 23:30:24 +03:00
16 lines
281 B
C
16 lines
281 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;
|
|
}
|