summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-11-22 15:56:31 +0100
committerYves Orton <demerphq@gmail.com>2022-11-23 11:28:17 +0100
commit69ae4519ab584cc86f0aa519698b760c4fc2ed0d (patch)
treeff5fd37d7a3e99e7df523c2f8b9ff8b334e108ec /util.c
parenta511d7dcd744640a1ebc498a80f1d05411368c83 (diff)
downloadperl-69ae4519ab584cc86f0aa519698b760c4fc2ed0d.tar.gz
util.c - clarify unusual use of rcpv_new()
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util.c b/util.c
index bc129d272b..b0bf189ca1 100644
--- a/util.c
+++ b/util.c
@@ -2389,7 +2389,9 @@ Perl_new_warnings_bitfield(pTHX_ char *buffer, const char *const bits,
PERL_UNUSED_CONTEXT;
PERL_ARGS_ASSERT_NEW_WARNINGS_BITFIELD;
- buffer = rcpv_new(buffer, len_wanted, RCPVf_NO_COPY);
+ /* pass in null as the source string as we will do the
+ * copy ourselves. */
+ buffer = rcpv_new(NULL, len_wanted, RCPVf_NO_COPY);
Copy(bits, buffer, size, char);
if (size < WARNsize)
Zero(buffer + size, WARNsize - size, char);