From b28f441103fbcc39cc45760802a62c2e8035edba Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 19 Nov 2015 23:28:04 +0000 Subject: it is not necessary to cast the result of malloc/calloc. also replace some 0s with the modern concept of NULL --- usr.bin/lex/filter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr.bin/lex/filter.c') diff --git a/usr.bin/lex/filter.c b/usr.bin/lex/filter.c index a7a1141d041..8daa1db4a15 100644 --- a/usr.bin/lex/filter.c +++ b/usr.bin/lex/filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filter.c,v 1.5 2015/11/19 23:20:34 tedu Exp $ */ +/* $OpenBSD: filter.c,v 1.6 2015/11/19 23:28:03 tedu Exp $ */ /* filter - postprocessing of flex output through filters */ @@ -50,7 +50,7 @@ filter_create_ext(struct filter * chain, const char *cmd, va_list ap; /* allocate and initialize new filter */ - f = (struct filter *) malloc(sizeof(struct filter)); + f = malloc(sizeof(struct filter)); if (!f) flexerror(_("malloc failed (f) in filter_create_ext")); memset(f, 0, sizeof(*f)); @@ -103,7 +103,7 @@ filter_create_int(struct filter * chain, struct filter *f; /* allocate and initialize new filter */ - f = (struct filter *) malloc(sizeof(struct filter)); + f = malloc(sizeof(struct filter)); if (!f) flexerror(_("malloc failed in filter_create_int")); memset(f, 0, sizeof(*f)); @@ -293,7 +293,7 @@ filter_tee_header(struct filter * chain) fprintf(to_c, "m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n", outfilename ? outfilename : ""); - buf = (char *) malloc(readsz); + buf = malloc(readsz); if (!buf) flexerror(_("malloc failed in filter_tee_header")); while (fgets(buf, readsz, stdin)) { @@ -357,7 +357,7 @@ filter_fix_linedirs(struct filter * chain) if (!chain) return 0; - buf = (char *) malloc(readsz); + buf = malloc(readsz); if (!buf) flexerror(_("malloc failed in filter_fix_linedirs")); -- cgit v1.2.3