From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: Fix strverscmp
Date: Wed, 5 Dec 2012 23:14:56 -0500 [thread overview]
Message-ID: <20121206041456.GR20323@brightrain.aerifal.cx> (raw)
In-Reply-To: <20121205191819.e83c8c3c.idunham@lavabit.com>
On Wed, Dec 05, 2012 at 07:18:19PM -0800, Isaac Dunham wrote:
> > It can't set the flag unconditionally, only if the previous byte was
> > not a digit. Otherwise, non-leading zeros would break handling of
> > numeric differences.
> Fortunately for us, that appears to be incorrect:
> idunham@Caracal:~$ ./a.out jan012 jan0111
> 1
> 1
> idunham@Caracal:~$ ./a.out jan0001 jan001
> -1
> -1
> idunham@Caracal:~$ ./a.out 0001 001
> -1
> -1
> idunham@Caracal:~$ ./a.out 001 0001
> 1
> 1
> idunham@Caracal:~$ ./a.out 0012 00111
> 1
> 1
> idunham@Caracal:~$ ./a.out 00012 00111
> -1
> -1
> idunham@Caracal:~$ ./a.out 00120 00111
> 1
> 1
>
> That's testing with the attached version.
All that means is that you missed testing any case where it differs.
./a.out s10212 s102102
2
-1
Rich
next prev parent reply other threads:[~2012-12-06 4:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 19:09 [PATCH] " Isaac Dunham
2012-12-05 19:35 ` Rich Felker
2012-12-06 0:43 ` Isaac Dunham
2012-12-06 1:00 ` Rich Felker
2012-12-06 2:14 ` Rich Felker
2012-12-06 2:21 ` Isaac Dunham
2012-12-06 2:26 ` Rich Felker
2012-12-06 3:18 ` Isaac Dunham
2012-12-06 4:14 ` Rich Felker [this message]
2012-12-07 0:36 ` Isaac Dunham
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=20121206041456.GR20323@brightrain.aerifal.cx \
--to=dalias@aerifal.cx \
--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).