delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/09/09/05:31:15

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "philippe meynard" <philippe DOT meynard AT vendeeconcept DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Pb with sprintf
Date: Fri, 9 Sep 2005 11:26:04 +0200
Organization: Guest of France Telecom's news reading service
Lines: 100
Message-ID: <dfrkfd$bp7$1@s1.news.oleane.net>
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> <2497d9a205090811344d981e1 AT mail DOT gmail DOT com>
NNTP-Posting-Host: 62.161.106.155
Mime-Version: 1.0
X-Trace: s1.news.oleane.net 1126257965 12071 62.161.106.155 (9 Sep 2005 09:26:05 GMT)
X-Complaints-To: abuse AT oleane DOT net
NNTP-Posting-Date: Fri, 9 Sep 2005 09:26:05 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.

------=_NextPart_000_00BC_01C5B531.43ECBB20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Chaf[100] is defined in static.
  "Matthew Petricone" <strstream AT gmail DOT com> a =E9crit dans le message de =
news: 2497d9a205090811344d981e1 AT mail DOT gmail DOT com...
  Is chaf[100] maybe really something like char *chaf; which is not =
really 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:
    Joe Wright <jwright AT comcast DOT net> wrote:

    > What could sprintf() do with malloc()?

    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=20
    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.

    --
    Hans-Bernhard Broeker ( broeker AT physik DOT rwth-aachende)
    Even if all the snow were burnt, ashes would remain.



------=_NextPart_000_00BC_01C5B531.43ECBB20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Chaf[100] is defined in =
static.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>"Matthew Petricone" &lt;<A=20
  href=3D"mailto:strstream AT gmail DOT com">strstream AT gmail DOT com</A>&gt; a =
=E9crit dans le=20
  message de news: <A=20
  =
href=3D"mailto:2497d9a205090811344d981e1 AT mail DOT gmail DOT com">2497d9a205090811=
344d981e1 AT mail DOT gmail DOT com</A>...</DIV>Is=20
  chaf[100] maybe really something like char *chaf; which is not really=20
  malloced?&nbsp; or maybe freed early, that would crash.<BR><BR>
  <DIV><SPAN class=3Dgmail_quote>On 8 Sep 2005 11:59:17 GMT, <B=20
  class=3Dgmail_sendername>Hans-Bernhard Broeker </B>&lt;<A=20
  =
href=3D"mailto:broeker AT physik DOT rwth-aachen DOT de">broeker AT physik DOT rwth-aachen.=
de</A>&gt;=20
  wrote:</SPAN>
  <BLOCKQUOTE class=3Dgmail_quote=20
  style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">Joe=20
    Wright &lt;<A =
href=3D"mailto:jwright AT comcast DOT net">jwright AT comcast DOT net</A>&gt;=20
    wrote:<BR><BR>&gt; What could sprintf() do with =
malloc()?<BR><BR>Construct=20
    itself a temporary buffer to work in --- the output buffer<BR>may =
not be=20
    large enough. <BR><BR>If sprintf() were a standalone "real" function =
that=20
    does all the work<BR>itself, it probably wouldn't need =
that.&nbsp;&nbsp;But=20
    in modern C runtimes,<BR>sprintf() may well be a specialization of=20
    vsnprintf(), which may a <BR>need a buffer to do its =
job.&nbsp;&nbsp;Or=20
    sprintf() could be implemented via an<BR>in-memory pseudo file, i.e. =
it may=20
    need to construct a FILE * to pass<BR>to the underlying generic=20
    routines.<BR><BR>--<BR>Hans-Bernhard Broeker ( <A=20
    =
href=3D"mailto:broeker AT physik DOT rwth-aachen DOT de">broeker AT physik DOT rwth-aachend=
e</A>)<BR>Even=20
    if all the snow were burnt, ashes would=20
remain.<BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00BC_01C5B531.43ECBB20--

- Raw text -


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