This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pointer to invalid multibyte sequence in mbsnrtowcs()


Hi Michael,

> Output 1.2:
>
>     status: 1
>     Success
>     ori=0x556497c29980
>     new=0x556497c29983

POSIX says:

   If the input buffer ends with an incomplete character, it is
unspecified whether conversion stops
   at the end of the previous character (if any), or at the end of the
input buffer.

As we see from the output of Example 1.2, glibc adopter the former behavior.
But why *src was incremented by 3 to point past the end of the buffer
(from 0x556497c29980 to 0x556497c29983), not to the next multibyte
sequence to be converted (i.e., 0x556497c29982)?

Is this POSIX behavior (and thus mbsnrtowcs(3) should be updated) or
it is a bug?

Thanks,
Igor


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]