This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: FW: Bug in diag_[v]snprintf
- From: Gary Thomas <gary at mlbassoc dot com>
- To: CSEBITS Christoph <Christoph dot CSEBITS at frequentis dot com>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Tue, 08 Feb 2005 08:27:54 -0700
- Subject: Re: [ECOS] FW: Bug in diag_[v]snprintf
- Organization: MLB Associates
- References: <8496FC30DD34AB42A5714FFE642938EB399B4D@FRQVIEEX01.frequentis.frq>
On Tue, 2005-02-08 at 16:24 +0100, CSEBITS Christoph wrote:
> -----Original Message-----
> From: BINDER Thomas
> Sent: Dienstag, 08. Februar 2005 16:18
> To: CSEBITS Christoph
> Subject: Bug in diag_[v]snprintf
>
> Hi
>
> We found a problem in the implementation of diag_snprintf, and
> diag_vsnprintf. The functions effectively write len+1 bytes (instead of len
> bytes) to the character buffer.
>
> According to the man page of snprintf this behaviour is wrong:
>
> [...]
> strings). snprintf and vsnprintf do not write more than
> size bytes (including the trailing '\0'), and return -1 if
> [...]
How about proposing a patch? After all, this is an open source
project :-)
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss