delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/09/08/14:35:34

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
b=MqzcWSzNahAg/vsfocfeAGk7EH00RORRrGtvo3Opc61qCk3BfwMpAzAbbHDNLZCCL7jYA+4TMYkJ0l6+3g+Q8Tr7KbMaEbqaIhjt8goknkbvfgKKbxUrecvISQAh5471dZ0IoXsmYEBC69841qnHQ/hYpIsZ/kgB/RyGrMt7Y4M=
Message-ID: <2497d9a205090811344d981e1@mail.gmail.com>
Date: Thu, 8 Sep 2005 14:34:38 -0400
From: Matthew Petricone <strstream AT gmail DOT com>
To: djgpp AT delorie DOT com
Subject: Re: Pb with sprintf
In-Reply-To: <3oanclF4upp5U2@news.dfncis.de>
Mime-Version: 1.0
References: <dfmqgu$mfs$1 AT s1 DOT news DOT oleane DOT net>
<gL-dnSZBgocSw4LeRVn-uQ AT comcast DOT com>
<2497d9a2050907160124a508c7 AT mail DOT gmail DOT com>
<dfp3ue$2tk$1 AT s1 DOT news DOT oleane DOT net> <3oak7kF50c1lU2 AT news DOT dfncis DOT de>
<fKGdnQEh9rf6gb3eRVn-rQ AT comcast DOT com> <3oanclF4upp5U2 AT news DOT dfncis DOT de>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

------=_Part_32031_25140406.1126204478396
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Is chaf[100] maybe really something like char *chaf; which is not really=20
malloced? or maybe freed early, that would crash.

On 8 Sep 2005 11:59:17 GMT, Hans-Bernhard Broeker <
broeker AT physik DOT rwth-aachen DOT de> wrote:
>=20
> Joe Wright <jwright AT comcast DOT net> wrote:
>=20
> > What could sprintf() do with malloc()?
>=20
> Construct itself a temporary buffer to work in --- the output buffer
> may not be large enough.
>=20
> If sprintf() were a standalone "real" function that does all the work
> itself, it probably wouldn't need that. But in modern C runtimes,
> sprintf() may well be a specialization of vsnprintf(), which may a
> need a buffer to do its job. Or sprintf() could be implemented via an
> in-memory pseudo file, i.e. it may need to construct a FILE * to pass
> to the underlying generic routines.
>=20
> --
> Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
> Even if all the snow were burnt, ashes would remain.
>

------=_Part_32031_25140406.1126204478396
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Is chaf[100] maybe really something like char *chaf; which is not really ma=
lloced?&nbsp; or maybe freed early, that would crash.<br><br><div><span cla=
ss=3D"gmail_quote">On 8 Sep 2005 11:59:17 GMT, <b class=3D"gmail_sendername=
">Hans-Bernhard Broeker
</b> &lt;<a href=3D"mailto:broeker AT physik DOT rwth-aachen DOT de">broeker AT physik DOT rw=
th-aachen.de</a>&gt; wrote:</span><blockquote class=3D"gmail_quote" style=
=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; p=
adding-left: 1ex;">
Joe Wright &lt;<a href=3D"mailto:jwright AT comcast DOT net">jwright AT comcast DOT net</=
a>&gt; wrote:<br><br>&gt; What could sprintf() do with malloc()?<br><br>Con=
struct itself a temporary buffer to work in --- the output buffer<br>may no=
t be large enough.
<br><br>If sprintf() were a standalone &quot;real&quot; function that does =
all the work<br>itself, it probably wouldn't need that.&nbsp;&nbsp;But in m=
odern C runtimes,<br>sprintf() may well be a specialization of vsnprintf(),=
 which may a
<br>need a buffer to do its job.&nbsp;&nbsp;Or sprintf() could be implement=
ed via an<br>in-memory pseudo file, i.e. it may need to construct a FILE * =
to pass<br>to the underlying generic routines.<br><br>--<br>Hans-Bernhard B=
roeker (
<a href=3D"mailto:broeker AT physik DOT rwth-aachen DOT de">broeker AT physik DOT rwth-aachen=
.de</a>)<br>Even if all the snow were burnt, ashes would remain.<br></block=
quote></div><br>

------=_Part_32031_25140406.1126204478396--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019