public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org
To: ecos-patches@ecos.sourceware.org
Subject: [Bug 1001490] C99 snprintf() does not include terminated null in truncated strings
Date: Thu, 09 Aug 2012 10:00:00 -0000	[thread overview]
Message-ID: <20120809100017.01D2D151A010@mail.ecoscentric.com> (raw)
In-Reply-To: <bug-1001490-104@http.bugs.ecos.sourceware.org/>

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001490

--- Comment #8 from Bernd Edlinger <bernd.edlinger@hotmail.de> 2012-08-09 11:00:15 BST ---
(In reply to comment #7)
Sergei,

> > This function needs 816 bytes on the stack,
> > even if you do not use any %f formats!
> > 
> > Maybe reducing this number could be worth the effort.
> Even if CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT is not defined?                 

hmm, thats funny.....

Without that define it is only 152 bytes.
That is 664 bytes difference.
BUT #define BUF changes only from 40 to 326.

Incredible, but I think I can reduce this easily:
cvt(), round(), and exponent() are all inlined.
However, char expbuf[MAXEXP] is 308 bytes!!!

but the largest possible exponent, "308", needs 3 only bytes.
Good you asked about that. Thanks!

This will reduce the stack use by 305 bytes.


> Bernd, could you, please, prepare the patch on 0-padding with ChangeLog         
> entry?  It seems to me the patch can be submitted for bug #20804               
> record.
> Thank you,
> Sergei

Ok, I am going to fix that stack issue too, and if you do not mind,
I'd also like to fix the %g issue [Bug #1001628] and submit a cumulative
patch at [Bug #20804].

Thanks,
Bernd.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

  parent reply	other threads:[~2012-08-09 10:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 13:11 [Bug 1001490] New: " bugzilla-daemon
2012-06-27 18:37 ` [Bug 1001490] " bugzilla-daemon
2012-08-07 10:06 ` bugzilla-daemon
2012-08-07 16:44 ` bugzilla-daemon
2012-08-08  7:31 ` bugzilla-daemon
2012-08-08 16:58 ` bugzilla-daemon
2012-08-09  7:50 ` bugzilla-daemon
2012-08-09  8:52 ` bugzilla-daemon
2012-08-09 10:00 ` bugzilla-daemon [this message]
2012-08-09 10:52 ` bugzilla-daemon
2012-08-09 11:04 ` bugzilla-daemon
2013-02-18 22:00 ` bugzilla-daemon
2013-02-19 10:40 ` bugzilla-daemon
2013-02-19 13:58 ` bugzilla-daemon

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=20120809100017.01D2D151A010@mail.ecoscentric.com \
    --to=bugzilla-daemon@bugs.ecos.sourceware.org \
    --cc=ecos-patches@ecos.sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).