summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-10-13 11:42:12 -0500
committerSteve Peters <steve@fisharerojo.org>2005-10-13 23:03:46 +0000
commit551405c409d33bc8cd0a20177c4ee21a204d18b5 (patch)
tree42d3d3344712d171624bc4d793b87f019234bba4 /utf8.c
parentb1681ed3d2d7fce28f676043b07816f4fad94f55 (diff)
downloadperl-551405c409d33bc8cd0a20177c4ee21a204d18b5.tar.gz
Stas' croak patch and then some
Message-ID: <20051013214212.GA1122@petdance.com> p4raw-id: //depot/perl@25754
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/utf8.c b/utf8.c
index 8ea2d7a76d..743dea4b5c 100644
--- a/utf8.c
+++ b/utf8.c
@@ -560,10 +560,12 @@ malformed:
if (s == s0)
Perl_sv_catpvf(aTHX_ sv, "(unexpected non-continuation byte 0x%02"UVxf", immediately after start byte 0x%02"UVxf")",
(UV)s[1], startbyte);
- else
+ else {
+ const int len = (int)(s-s0);
Perl_sv_catpvf(aTHX_ sv, "(unexpected non-continuation byte 0x%02"UVxf", %d byte%s after start byte 0x%02"UVxf", expected %d bytes)",
- (UV)s[1], s - s0, s - s0 > 1 ? "s" : "", startbyte, (int)expectlen);
-
+ (UV)s[1], len, len > 1 ? "s" : "", startbyte, (int)expectlen);
+ }
+
break;
case UTF8_WARN_FE_FF:
Perl_sv_catpvf(aTHX_ sv, "(byte 0x%02"UVxf")", uv);