diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-03-21 22:32:57 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-03-21 22:32:57 +0000 |
commit | d67b2b05efca2a57f7f25e521450c200ef38803e (patch) | |
tree | af12b114d51e9ae7a8753baf09feb9ab8d654f26 /tr.c | |
parent | cfe2ce6d7262d074b6fe0c1dea4d96df37e8a9ef (diff) | |
download | busybox-w32-d67b2b05efca2a57f7f25e521450c200ef38803e.tar.gz busybox-w32-d67b2b05efca2a57f7f25e521450c200ef38803e.tar.bz2 busybox-w32-d67b2b05efca2a57f7f25e521450c200ef38803e.zip |
* 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
git-svn-id: svn://busybox.net/trunk/busybox@416 69ca8d6d-28ef-0310-b511-8ec308f3f277
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"; | |||
44 | #endif | 44 | #endif |
45 | static const char rcsid[] = | 45 | static const char rcsid[] = |
46 | 46 | ||
47 | "$Id: tr.c,v 1.1 2000/03/05 08:07:00 erik Exp $"; | 47 | "$Id: tr.c,v 1.2 2000/03/21 22:32:57 erik Exp $"; |
48 | #endif /* not lint */ | 48 | #endif /* not lint */ |
49 | #endif /* #if 0 */ | 49 | #endif /* #if 0 */ |
50 | 50 | ||
@@ -433,8 +433,7 @@ STR *s; | |||
433 | "unknown class %s", | 433 | "unknown class %s", |
434 | s->str); | 434 | s->str); |
435 | 435 | ||
436 | if ((cp->set = p = malloc((NCHARS + 1) * sizeof(int))) == NULL) | 436 | cp->set = p = xmalloc((NCHARS + 1) * sizeof(int)); |
437 | errx(1, "malloc"); | ||
438 | bzero(p, (NCHARS + 1) * sizeof(int)); | 437 | bzero(p, (NCHARS + 1) * sizeof(int)); |
439 | 438 | ||
440 | for (cnt = 0, func = cp->func; cnt < NCHARS; ++cnt) | 439 | for (cnt = 0, func = cp->func; cnt < NCHARS; ++cnt) |