diff options
author | 2015-08-20 22:46:32 +0000 | |
---|---|---|
committer | 2015-08-20 22:46:32 +0000 | |
commit | 74590bb3de02617477eefe3939bcaf044841b987 (patch) | |
tree | 5fb279a7723f2bdab4edeb77b87b8aa97f8d227e /usr.sbin/lpr | |
parent | stdlib.h is in scope; do not cast malloc/calloc/realloc* (diff) | |
download | wireguard-openbsd-74590bb3de02617477eefe3939bcaf044841b987.tar.xz wireguard-openbsd-74590bb3de02617477eefe3939bcaf044841b987.zip |
stdlib.h is in scope; do not cast malloc/calloc/realloc*
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 6 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/displayq.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/pac/pac.c | 8 |
4 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index e2d4a063545..9d47ffd9094 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.38 2015/01/16 06:40:17 deraadt Exp $ */ +/* $OpenBSD: common.c,v 1.39 2015/08/20 22:46:32 deraadt Exp $ */ /* $NetBSD: common.c,v 1.21 2000/08/09 14:28:50 itojun Exp $ */ /* @@ -245,7 +245,7 @@ getq(struct queue ***namelist) * and dividing it by a multiple of the minimum size entry. */ arraysz = (stbuf.st_size / 24); - queue = (struct queue **)calloc(arraysz, sizeof(struct queue *)); + queue = calloc(arraysz, sizeof(struct queue *)); if (queue == NULL) goto errdone; @@ -258,7 +258,7 @@ getq(struct queue ***namelist) continue; /* Doesn't exist */ } PRIV_END; - q = (struct queue *)malloc(sizeof(struct queue)); + q = malloc(sizeof(struct queue)); if (q == NULL) goto errdone; q->q_time = stbuf.st_mtime; diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index 0d401b7a7b5..947d1903c2e 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: displayq.c,v 1.36 2015/01/16 06:40:17 deraadt Exp $ */ +/* $OpenBSD: displayq.c,v 1.37 2015/08/20 22:46:32 deraadt Exp $ */ /* $NetBSD: displayq.c,v 1.21 2001/08/30 00:51:50 itojun Exp $ */ /* @@ -285,7 +285,7 @@ displayq(int format) nsa.sa_flags = 0; (void)sigaction(SIGALRM, &nsa, &osa); alarm(wait_time); - if ((visline = (char *)malloc(4 * sizeof(line) + 1)) == NULL) + if ((visline = malloc(4 * sizeof(line) + 1)) == NULL) fatal("Out of memory"); while ((i = read(fd, line, sizeof(line))) > 0) { n = strvisx(visline, line, i, VIS_SAFE|VIS_NOSLASH); diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 5445a50ad6b..ec8edd73069 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printjob.c,v 1.54 2015/01/16 06:40:18 deraadt Exp $ */ +/* $OpenBSD: printjob.c,v 1.55 2015/08/20 22:46:32 deraadt Exp $ */ /* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */ /* @@ -1572,7 +1572,7 @@ setty(void) syslog(LOG_INFO, "%s: ioctl(TIOCGWINSZ): %m", printer); - argv = (char **)calloc(256, sizeof(char *)); + argv = calloc(256, sizeof(char *)); if (argv == NULL) { syslog(LOG_ERR, "%s: malloc: %m", printer); exit(1); diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c index 1309a997c75..a5d811bcd4f 100644 --- a/usr.sbin/lpr/pac/pac.c +++ b/usr.sbin/lpr/pac/pac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pac.c,v 1.24 2015/02/09 23:00:14 deraadt Exp $ */ +/* $OpenBSD: pac.c,v 1.25 2015/08/20 22:46:32 deraadt Exp $ */ /* $NetBSD: pac.c,v 1.14 2000/04/27 13:40:18 msaitoh Exp $ */ /* @@ -271,7 +271,7 @@ dumpit(void) hp = hashtab[0]; hno = 1; - base = (struct hent **) calloc(hcount, sizeof(hp)); + base = calloc(hcount, sizeof(hp)); if (base == NULL) err(1, NULL); for (ap = base, c = hcount; c--; ap++) { @@ -353,7 +353,7 @@ enter(const char *name) return(hp); h = hash(name); hcount++; - hp = (struct hent *) malloc(sizeof *hp); + hp = malloc(sizeof *hp); if (hp == NULL) err(1, NULL); hp->h_name = strdup(name); @@ -444,7 +444,7 @@ chkprinter(const char *s) if (!pflag && (cgetnum(bp, "pc", &price100) == 0)) price = price100/10000.0; len = strlen(acctfile) + 5; - sumfile = (char *) malloc(len); + sumfile = malloc(len); if (sumfile == NULL) err(1, "pac"); strlcpy(sumfile, acctfile, len); |