Convert codebase to use emalloc.c utility-functions

This also definitely increases readability and makes OOM-conditions
more consistent.
This commit is contained in:
FRIGN
2014-11-16 11:07:26 +01:00
committed by sin
parent 045fc62028
commit e17b9cdd0a
10 changed files with 22 additions and 36 deletions

3
cut.c
View File

@@ -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;