Merge branch 'merge-requests/23'

This commit is contained in:
Craig Small 2014-01-30 22:12:28 +11:00
commit ca99070012

10
pgrep.c
View File

@ -142,13 +142,19 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
static struct el *split_list (const char *restrict str, int (*convert)(const char *, struct el *)) static struct el *split_list (const char *restrict str, int (*convert)(const char *, struct el *))
{ {
char *copy = xstrdup (str); char *copy;
char *ptr = copy; char *ptr;
char *sep_pos; char *sep_pos;
int i = 0; int i = 0;
int size = 0; int size = 0;
struct el *list = NULL; struct el *list = NULL;
if (str[0] == '\0')
return NULL;
copy = xstrdup (str);
ptr = copy;
do { do {
if (i == size) { if (i == size) {
size = size * 5 / 4 + 4; size = size * 5 / 4 + 4;