summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 22:32:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 22:32:43 +0000
commit6e5d9523d6273368df6377a4db98a9533d11505c (patch)
tree665d65c04b5874cca0392587a8c45d740f3af051 /usr.bin/cvs
parent856a95e3f951c7875c113b683b773a7bccf1e685 (diff)
Do not cast result of malloc/calloc/realloc* if stdlib.h is in scope
ok krw millert
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/entries.c8
-rw-r--r--usr.bin/cvs/file.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 83eb9612ca1..64043d81410 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.104 2015/04/04 14:19:10 stsp Exp $ */
+/* $OpenBSD: entries.c,v 1.105 2015/08/20 22:32:41 deraadt Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -51,7 +51,7 @@ cvs_ent_open(const char *dir)
current_list = NULL;
}
- ep = (CVSENTRIES *)xcalloc(1, sizeof(*ep));
+ ep = xcalloc(1, sizeof(*ep));
ep->cef_path = xstrdup(buf);
(void)xsnprintf(buf, sizeof(buf), "%s/%s",
@@ -72,7 +72,7 @@ cvs_ent_open(const char *dir)
if (buf[0] == 'D' && buf[1] == '\0')
break;
- line = (struct cvs_ent_line *)xmalloc(sizeof(*line));
+ line = xmalloc(sizeof(*line));
line->buf = xstrdup(buf);
TAILQ_INSERT_TAIL(&(ep->cef_ent), line, entries_list);
}
@@ -329,7 +329,7 @@ cvs_ent_add(CVSENTRIES *ep, const char *line)
(void)fclose(fp);
- l = (struct cvs_ent_line *)xmalloc(sizeof(*l));
+ l = xmalloc(sizeof(*l));
l->buf = xstrdup(line);
TAILQ_INSERT_TAIL(&(ep->cef_ent), l, entries_list);
}
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index 519c88f7198..06879f2a932 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.265 2015/02/05 12:59:57 millert Exp $ */
+/* $OpenBSD: file.c,v 1.266 2015/08/20 22:32:41 deraadt Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
@@ -216,7 +216,7 @@ cvs_file_get(char *name, int flags, struct cvs_flisthead *fl, int type)
if (l != NULL)
return (l);
- l = (struct cvs_filelist *)xmalloc(sizeof(*l));
+ l = xmalloc(sizeof(*l));
l->file_path = xstrdup(p);
l->flags = flags;
l->type = type;
@@ -235,7 +235,7 @@ cvs_file_get_cf(const char *d, const char *f, const char *fpath, int fd,
for (p = fpath; p[0] == '.' && p[1] == '/';)
p += 2;
- cf = (struct cvs_file *)xcalloc(1, sizeof(*cf));
+ cf = xcalloc(1, sizeof(*cf));
cf->file_name = xstrdup(f);
cf->file_wd = xstrdup(d);