@@ -24,9 +24,9 @@ index d9f092c48c..fe8b7228a1 100644
2424 {
2525- const SRC_UNIT *s_end = s + n;
2626+ const SRC_UNIT *s_end = END_OF_ARRAY (s, n);
27+
2728 /* Output string accumulator. */
2829 DST_UNIT *result;
29- size_t allocated;
3030@@ -77,7 +90,7 @@ FUNC (const SRC_UNIT *s, size_t n, DST_UNIT *resultbuf, size_t *lengthp)
3131 s += count;
3232
@@ -71,15 +71,15 @@ index 0c4f0bc3cc..9741058440 100644
7171 {
7272- const SRC_UNIT *s_end = s + n;
7373+ const SRC_UNIT *s_end = END_OF_ARRAY (s, n);
74+
7475 /* Output string accumulator. */
7576 DST_UNIT *result;
76- size_t allocated;
7777@@ -63,7 +76,7 @@ FUNC (const SRC_UNIT *s, size_t n, DST_UNIT *resultbuf, size_t *lengthp)
7878 u8_uctomb will verify uc anyway. */
7979
8080 /* Store it in the output string. */
81- - count = u8_uctomb (result + length, uc, allocated - length);
82- + count = u8_uctomb (END_OF_ARRAY (result, length), uc, allocated - length);
81+ - int count = u8_uctomb (result + length, uc, allocated - length);
82+ + int count = u8_uctomb (END_OF_ARRAY (result, length), uc, allocated - length);
8383 if (count == -1)
8484 {
8585 if (!(result == resultbuf || result == NULL))
0 commit comments