We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a1c261 commit a9f14afCopy full SHA for a9f14af
ext/intl/grapheme/grapheme_string.cpp
@@ -1181,13 +1181,17 @@ U_CFUNC PHP_FUNCTION(grapheme_strrev)
1181
current = ZSTR_LEN(string);
1182
for (end = pstr; pos != UBRK_DONE; ) {
1183
pos = ubrk_previous(bi);
1184
+ if (pos == UBRK_DONE) {
1185
+ break;
1186
+ }
1187
end_len = current - pos;
1188
for (int32_t j = 0; j < end_len; j++) {
1189
*p++ = *(pstr + pos + j);
1190
}
1191
current = pos;
1192
1193
ubrk_end:
1194
+ *p = '\0';
1195
RETVAL_NEW_STR(ret);
1196
ubrk_close(bi);
1197
close:
0 commit comments