mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: jiahao jia <jhsduguge@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: Some problems with the Strxfrm() function and the Wcsxfrm() function in the MUSL Lic
Date: Wed, 7 Aug 2019 12:42:09 -0400	[thread overview]
Message-ID: <20190807164209.GC9017@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAE-BVWhi-sKS4H7z--RJEF4-Z+ME3GAiVe0S9FjZhR2CcNEnzg@mail.gmail.com>

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


           reply	other threads:[~2019-08-07 16:42 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAE-BVWhi-sKS4H7z--RJEF4-Z+ME3GAiVe0S9FjZhR2CcNEnzg@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190807164209.GC9017@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=jhsduguge@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).