File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2534,6 +2534,17 @@ Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *lenp)
2534
2534
continue ;
2535
2535
}
2536
2536
2537
+ goto cant_convert ;
2538
+ }
2539
+
2540
+ /* Success! */
2541
+ * d = '\0' ;
2542
+ * lenp = d - save ;
2543
+
2544
+ return save ;
2545
+
2546
+ cant_convert : ;
2547
+
2537
2548
/* Here, it is malformed. This shouldn't happen on EBCDIC, and on ASCII
2538
2549
* platforms, we know that the only start bytes in the text are C2 and C3,
2539
2550
* and the code above has made sure that it doesn't end with a start byte.
@@ -2580,13 +2591,6 @@ Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *lenp)
2580
2591
2581
2592
* lenp = ((STRLEN ) - 1 );
2582
2593
return NULL ;
2583
- }
2584
-
2585
- /* Success! */
2586
- * d = '\0' ;
2587
- * lenp = d - save ;
2588
-
2589
- return save ;
2590
2594
}
2591
2595
2592
2596
/*
You can’t perform that action at this time.
0 commit comments