diff options
author | Erik Andersen | 2000-03-21 22:32:57 +0000 |
---|---|---|
committer | Erik Andersen | 2000-03-21 22:32:57 +0000 |
commit | 0d068a20676144e9fd6796cc77764c420d785394 (patch) | |
tree | af12b114d51e9ae7a8753baf09feb9ab8d654f26 /tr.c | |
parent | c053e41fa0524d828bf90f47e5e3637b8facaadc (diff) | |
download | busybox-0d068a20676144e9fd6796cc77764c420d785394.zip busybox-0d068a20676144e9fd6796cc77764c420d785394.tar.gz |
* all mallocs now use xmalloc (and so are OOM error safe), and
the common error handling saves a few bytes. Thanks to
Bob Tinsley <bob@earthrise.demon.co.uk> for the patch.
-Erik
Diffstat (limited to 'tr.c')
-rw-r--r-- | tr.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -44,7 +44,7 @@ static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95"; #endif static const char rcsid[] = - "$Id: tr.c,v 1.1 2000/03/05 08:07:00 erik Exp $"; + "$Id: tr.c,v 1.2 2000/03/21 22:32:57 erik Exp $"; #endif /* not lint */ #endif /* #if 0 */ @@ -433,8 +433,7 @@ STR *s; "unknown class %s", s->str); - if ((cp->set = p = malloc((NCHARS + 1) * sizeof(int))) == NULL) - errx(1, "malloc"); + cp->set = p = xmalloc((NCHARS + 1) * sizeof(int)); bzero(p, (NCHARS + 1) * sizeof(int)); for (cnt = 0, func = cp->func; cnt < NCHARS; ++cnt) |