mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: Some problems with the Strxfrm() function and the Wcsxfrm() function in the MUSL Lic
       [not found] <CAE-BVWhi-sKS4H7z--RJEF4-Z+ME3GAiVe0S9FjZhR2CcNEnzg@mail.gmail.com>
@ 2019-08-07 16:42 ` Rich Felker
  0 siblings, 0 replies; only message in thread
From: Rich Felker @ 2019-08-07 16:42 UTC (permalink / raw)
  To: jiahao jia; +Cc: musl

On Wed, Aug 07, 2019 at 11:57:36PM +0800, jiahao jia wrote:
> Dear Rich Felker:
> 
>     When I was referring to your code, I found that there were some
> problems with the Strxfrm() function and the Wcsxfrm() function in the MUSL
> Lic library. The two functions are located in the
> “musl-1.1.23\src\locale”  directory. The original codes are as follows:
> 
> 
> 
>     As for the Strxfrm() function, when n = l or n < l, the copy string
> function is not executed.
>     As for the Wcsxfrm() function, when n = 1, l = 2, a character of the
> source string is not copied, but only one ‘\0’.
> 
>     In response to the above questions, I made the following changes:
> 
> 
> I am looking forward to your reply as soon as possible!

It looks like you intended to include or attach a patch but there
doesn't seem to be any. Note that, per the specification:

    "If the value returned is n or more, the contents of the array
    pointed to by s1 are unspecified."

So unless I'm missing something by not seeing your patch, I think both
functions are currently correct, but the inconsistency might not make
sense to keep. If we want to change it we should think about what
behavior would be help catch errors and reduce danger of incorrect
programs that expect a meaningful result.

Rich


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-07 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAE-BVWhi-sKS4H7z--RJEF4-Z+ME3GAiVe0S9FjZhR2CcNEnzg@mail.gmail.com>
2019-08-07 16:42 ` Some problems with the Strxfrm() function and the Wcsxfrm() function in the MUSL Lic Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).