summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2016-03-15 01:00:18 +0000
committermmcc <mmcc@cvs.openbsd.org>2016-03-15 01:00:18 +0000
commit99010606ab24469d3c7b373ac5cc91edfd1b2cd3 (patch)
treec1c4e5dd5c2842153917af6fc83f865607ad77e7
parentf779382c98d99e6d7457e2c790d177db942b5af3 (diff)
Replace two malloc casts that deraadt@ and I removed over the past year
or two. Upstream wants to keep them for C++ support, and it isn't worth maintaining a larger diff. No binary change. Upstream commit: https://github.com/fanf2/unifdef/commit/87dfd91 I'll send more merging diffs to tech@ soon.
-rw-r--r--usr.bin/unifdef/unifdef.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/unifdef/unifdef.c b/usr.bin/unifdef/unifdef.c
index 4fe4902305e..936cdded1e9 100644
--- a/usr.bin/unifdef/unifdef.c
+++ b/usr.bin/unifdef/unifdef.c
@@ -1537,7 +1537,7 @@ astrcat(const char *s1, const char *s2)
if (len < 0)
err(2, "snprintf");
size = (size_t)len + 1;
- s = malloc(size);
+ s = (char *)malloc(size);
if (s == NULL)
err(2, "malloc");
snprintf(s, size, "%s%s", s1, s2);
@@ -1555,7 +1555,7 @@ xstrdup(const char *start, const char *end)
if (end < start) abort(); /* bug */
n = (size_t)(end - start) + 1;
- s = malloc(n);
+ s = (char *)malloc(n);
if (s == NULL)
err(2, "malloc");
snprintf(s, n, "%s", start);