Convert codebase to use emalloc.c utility-functions
This also definitely increases readability and makes OOM-conditions more consistent.
This commit is contained in:
3
cut.c
3
cut.c
@@ -63,8 +63,7 @@ parselist(char *str)
|
||||
if (*s == ',')
|
||||
n++;
|
||||
}
|
||||
if (!(r = malloc(n * sizeof(Range))))
|
||||
eprintf("malloc:");
|
||||
r = emalloc(n * sizeof(Range));
|
||||
for (s = str; n; n--, s++) {
|
||||
r->min = (*s == '-') ? 1 : strtoul(s, &s, 10);
|
||||
r->max = (*s == '-') ? strtoul(s + 1, &s, 10) : r->min;
|
||||
|
Reference in New Issue
Block a user