From: Ryan Flynn <parseerror@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Erik Faye-Lund <kusmabite@googlemail.com>,
Christian Couder <chriscool@tuxfamily.org>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] fix potential infinite loop given large unsigned integer
Date: Mon, 10 Aug 2009 12:14:43 -0400 [thread overview]
Message-ID: <a3f15ee60908100914n6d9e11fbk77a90f5619b9a860@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0908101421340.8324@intel-tinevez-2-302>
On Mon, Aug 10, 2009 at 8:24 AM, Johannes
Schindelin<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 10 Aug 2009, Erik Faye-Lund wrote:
>
>> On Mon, Aug 10, 2009 at 7:24 AM, Christian
>> Couder<chriscool@tuxfamily.org> wrote:
>> >> log10() appears to be C99, but can be emulated on earlier C-versions by
>> >> doing #define log10(x) (log(x) / log(10.0))
>> >
>> > That would mean linking with -lm?
>>
>> I guess so. Are we currently trying to avoid linking to the math-parts
>> of libc?
>
> Yes.
>
> I guess we could fix the overflow thing very easily, though:
>
> static unsigned int digits_of_number(unsigned int number) {
> unsigned int result;
> for (result = 1; number; number /= 10, result++)
> ; /* do nothing */
> return result;
> }
>
> Ciao,
> Dscho
>
>
that is equivalent to the original patch, yes.
next prev parent reply other threads:[~2009-08-10 16:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-09 4:41 [PATCH] fix potential infinite loop given large unsigned integer Ryan Flynn
2009-08-09 6:19 ` Junio C Hamano
2009-08-09 7:38 ` Junio C Hamano
2009-08-09 12:25 ` Erik Faye-Lund
2009-08-10 5:24 ` Christian Couder
2009-08-10 11:12 ` Erik Faye-Lund
2009-08-10 12:24 ` Johannes Schindelin
2009-08-10 16:14 ` Ryan Flynn [this message]
2009-08-10 16:17 ` Ryan Flynn
2009-08-10 16:53 ` Johannes Schindelin
2009-08-11 0:55 ` Jeff Epler
2009-08-10 0:23 ` Ryan Flynn
2009-08-10 18:19 ` Tony Finch
2009-08-09 23:16 ` Ryan Flynn
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=a3f15ee60908100914n6d9e11fbk77a90f5619b9a860@mail.gmail.com \
--to=parseerror@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kusmabite@googlemail.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.
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).