Skip to content

Commit 2b42d49

Browse files
committed
pp_pack NEXT_UNI_VAL: Replace utf8n_to_uvchr with utf8_to_uv_flags
1 parent 79ae12a commit 2b42d49

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pp_pack.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -408,16 +408,16 @@ STMT_START { \
408408
} STMT_END
409409

410410
/* Only to be used inside a loop (see the break) */
411-
#define NEXT_UNI_VAL(val, cur, str, end, utf8_flags) \
412-
STMT_START { \
413-
STRLEN retlen; \
414-
if (str >= end) break; \
415-
val = utf8n_to_uvchr((U8 *) str, end-str, &retlen, utf8_flags); \
416-
if (retlen == (STRLEN) -1) { \
417-
*cur = '\0'; \
418-
croak("Malformed UTF-8 string in pack"); \
419-
} \
420-
str += retlen; \
411+
#define NEXT_UNI_VAL(val, cur, str, end, utf8_flags) \
412+
STMT_START { \
413+
STRLEN retlen; \
414+
if (str >= end) break; \
415+
if (! utf8_to_uv_flags((U8 *) str, (U8 *) end, &val, &retlen, \
416+
utf8_flags)) { \
417+
*cur = '\0'; \
418+
croak("Malformed UTF-8 string in pack"); \
419+
} \
420+
str += retlen; \
421421
} STMT_END
422422

423423
static const char *_action( const tempsym_t* symptr )

0 commit comments

Comments
 (0)