index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Will Miles <wmiles@sgl.com> | 2015-02-27 14:43:23 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2015-03-03 16:54:17 +1000 |
commit | bb94729c098f21ae850044a9201c1d5b92baea1f (patch) | |
tree | 2f0ffe7f158bf4a8c458ebc78cc3cf35f7f63d4d /src/util/pacsort.c | |
parent | 8f92fe47a7c4d999271bc28ffbbeeea50d686813 (diff) |
-rw-r--r-- | src/util/pacsort.c | 23 |
diff --git a/src/util/pacsort.c b/src/util/pacsort.c index d864fdb9..9d248fad 100644 --- a/src/util/pacsort.c +++ b/src/util/pacsort.c @@ -25,6 +25,7 @@ #include <string.h> #include <alpm.h> +#include "util-common.h" #define DELIM ' ' @@ -69,28 +70,6 @@ static struct options_t { char delim; } opts; -#ifndef HAVE_STRNDUP -/* A quick and dirty implementation derived from glibc */ -static size_t strnlen(const char *s, size_t max) -{ - register const char *p; - for(p = s; *p && max--; ++p); - return (p - s); -} - -char *strndup(const char *s, size_t n) -{ - size_t len = strnlen(s, n); - char *new = (char *) malloc(len + 1); - - if(new == NULL) - return NULL; - - new[len] = '\0'; - return (char *)memcpy(new, s, len); -} -#endif - static struct buffer_t *buffer_new(size_t initial_size) { struct buffer_t *buf; |