diff options
author | 2016-03-15 01:00:17 +0000 | |
---|---|---|
committer | 2016-03-15 01:00:17 +0000 | |
commit | f6de66e981cbd4fc0fc8975c608e175c9b4462fc (patch) | |
tree | 492431d15f6cf1e44dad895d5eb780f854719f44 | |
parent | Change a bunch of (<blah> *)0 to NULL. (diff) | |
download | wireguard-openbsd-f6de66e981cbd4fc0fc8975c608e175c9b4462fc.tar.xz wireguard-openbsd-f6de66e981cbd4fc0fc8975c608e175c9b4462fc.zip |
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.c | 4 |
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); |