Introduce sstrndup wrapper.

This commit is contained in:
Michael Hofmann
2015-05-06 16:28:29 +02:00
parent 37bee99538
commit 0319bda1d4
4 changed files with 16 additions and 2 deletions

View File

@ -23,7 +23,7 @@ char *resolve_tilde(const char *path) {
char *head, *tail, *result;
tail = strchr(path, '/');
head = strndup(path, tail ? (size_t)(tail - path) : strlen(path));
head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path));
int res = glob(head, GLOB_TILDE, NULL, &globbuf);
free(head);