mbrtowc: Fix wrong return value when n > UINT_MAX
authorAlexey Izbyshev <izbyshev@ispras.ru>
Fri, 26 May 2023 16:34:14 +0000 (19:34 +0300)
committerRich Felker <dalias@aerifal.cx>
Fri, 26 May 2023 20:12:29 +0000 (16:12 -0400)
commit4653b98711f280270fa049654460610f587ba7b4
treeef549b38dadadcd3417706a438580cbc0030e8f8
parentb90841e2583237a4132bbbd74752e0e9563660cd
mbrtowc: Fix wrong return value when n > UINT_MAX

mbrtowc truncates n to unsigned int when storing its copy.
If n > UINT_MAX and the locale is not POSIX, the function will
return a wrong value greater than UINT_MAX on the success path.
src/multibyte/mbrtowc.c