summaryrefslogtreecommitdiff
path: root/text-utils
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@gnu.org>2010-10-22 12:26:24 -0300
committerKarel Zak <kzak@redhat.com>2010-11-01 15:17:11 +0100
commit3924d0f169525270e20b6183ee67bca5822d0291 (patch)
tree12b93bc7852c80badc5ef72419f83e3a02b54395 /text-utils
parentf0961db21f912511ed6ac7fee02e26b40efe0d8c (diff)
downloadutil-linux-old-3924d0f169525270e20b6183ee67bca5822d0291.tar.gz
rev: use xalloc for memory allocation
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/rev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/text-utils/rev.c b/text-utils/rev.c
index 7a42d7e4..b6924497 100644
--- a/text-utils/rev.c
+++ b/text-utils/rev.c
@@ -59,6 +59,7 @@
#include <signal.h>
#include "nls.h"
+#include "xalloc.h"
#include "widechar.h"
wchar_t *buf;
@@ -117,9 +118,7 @@ int main(int argc, char *argv[])
filename = *argv++;
}
- buf = malloc(bufsiz * sizeof(wchar_t));
- if (!buf)
- err(EXIT_FAILURE, _("malloc failed"));
+ buf = xmalloc(bufsiz * sizeof(wchar_t));
while (fgetws(buf, bufsiz, fp)) {
len = wcslen(buf);