diff options
author | David Mitchell <davem@iabyn.com> | 2017-05-29 16:20:17 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-06-07 09:11:06 +0100 |
commit | 52ffdfb42975c0a6a6ef7d48fb7a96ce2cb735c4 (patch) | |
tree | 506f1869f6b4944ffee341f101298d5a024c89e1 | |
parent | da0861421acf77ec0140c984134db5df0da4d2f8 (diff) | |
download | perl-52ffdfb42975c0a6a6ef7d48fb7a96ce2cb735c4.tar.gz |
Perl_sv_vcatpvfn_flags: warn on missing width arg
It didn't used to warn when the width value was obtained from the next or
specified arg, and there wasn't such an arg.
-rw-r--r-- | sv.c | 2 | ||||
-rw-r--r-- | t/op/sprintf.t | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -12039,7 +12039,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p i = va_arg(*args, int); else { ix = ix ? ix - 1 : svix++; - i = (ix < svmax) ? SvIVx(svargs[ix]) : 0; + i = (ix < svmax) ? SvIVx(svargs[ix]) : (arg_missing = TRUE, 0); } left |= (i < 0); width = (i < 0) ? -i : i; diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 7a28c1fb94..af7ad428fa 100644 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -765,3 +765,6 @@ e>%*v.*X< >[':', 3, '012']< >0F0:0F1:0F2< >perl #83194: vector flag + custom sep a>%vd< >"version"< >118.101.114.115.105.111.110< >perl #102586: vector flag + "version"< e>%vd< >"version"< >165.133.153.162.137.150.149< >perl #102586: vector flag + "version"< >%3$*4$v*2$.*1$x< >[3, 4, "\x11\x22\x33", "/"]< > 011/ 022/ 033< >four reordered args< +>%*%< >[]< >% MISSING< +>%*1$%< >[]< >% MISSING< +>%*2$d< >123< >123 MISSING< |