diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-18 17:10:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-18 17:10:49 +0000 |
commit | 16039796bdcfac8f82d612419ba2ad6874ce867d (patch) | |
tree | 515bd6ad6ccdb15282388b5de99d59ad60bbe7ad /usr.bin/cut | |
parent | ea220251979649ae3032b7f4830e8ec6f7930faf (diff) |
do not cast malloc() return if stdlib.h is included
Diffstat (limited to 'usr.bin/cut')
-rw-r--r-- | usr.bin/cut/cut.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c index 37cd4db2581..97322c15e02 100644 --- a/usr.bin/cut/cut.c +++ b/usr.bin/cut/cut.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cut.c,v 1.18 2014/02/02 11:44:01 sobrado Exp $ */ +/* $OpenBSD: cut.c,v 1.19 2015/08/18 17:10:48 deraadt Exp $ */ /* $NetBSD: cut.c,v 1.9 1995/09/02 05:59:23 jtc Exp $ */ /* @@ -225,7 +225,7 @@ f_cut(FILE *fp, char *fname) output = 0; if (lbuf[len - 1] != '\n') { /* no newline at the end of the last line so add one */ - if ((tbuf = (char *)malloc(len + 1)) == NULL) + if ((tbuf = malloc(len + 1)) == NULL) err(1, NULL); memcpy(tbuf, lbuf, len); tbuf[len] = '\n'; |