delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/09/07/19:02:15

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=eFfKJ3Zx+PKzl4ubYrP7on9UErnDNV6aTYqQkP/v45tZVzNNoEh0byCFo1Bc+S5dmMGTJr241hvqpOug5dduFt77wTJtjcfdzso7T7ju0iZbejNqVoh/jK9AWm7YhJJboBWdmPkgUmUxynUYc/GKgTqQNtiR0gkkU/ZYSXZHD5c=
Message-ID: <2497d9a2050907160124a508c7@mail.gmail.com>
Date: Wed, 7 Sep 2005 19:01:45 -0400
From: Matthew Petricone <strstream AT gmail DOT com>
To: djgpp AT delorie DOT com
Subject: Re: Pb with sprintf
In-Reply-To: <gL-dnSZBgocSw4LeRVn-uQ@comcast.com>
Mime-Version: 1.0
References: <dfmqgu$mfs$1 AT s1 DOT news DOT oleane DOT net>
<gL-dnSZBgocSw4LeRVn-uQ AT comcast DOT com>
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_26729_25303838.1126134105680
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Aye, is this the actuall code that's giving you the problem or just a=20
simplification?

On 9/7/05, Joe Wright <jwright AT comcast DOT net> wrote:
>=20
> philippe meynard wrote:
> > Hi! All
> >
> > do you know if the function sprintf used dos call dpmi_int (0x21) or=20
> return
> > the processor to the real mode or used malloc ?
> > Because I use LWP (multitasking library) and I have a crash on this=20
> function
> > sprintf !
> > I used sprintf like this :
> >
> > char chaf[100];
> > sprintf(chaf,"%d\n",100);
> >
> >
> > Thanks.
> >
> >
> >
> #include <stdio.h>
> #include <string.h>
>=20
> int main(void) {
> char chaf[100];
> sprintf(chaf, "%d", 100);
> printf("chaf length is %d and looks like %s\n",
> strlen(chaf), chaf);
> return 0;
> }
>=20
> Can't guess your problem. The above code works fine here.
> --
> Joe Wright
> "Everything should be made as simple as possible, but not simpler."
> --- Albert Einstein ---
>

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

Aye, is this the actuall code that's giving you the problem or just a simpl=
ification?<br><br><div><span class=3D"gmail_quote">On 9/7/05, <b class=3D"g=
mail_sendername">Joe Wright</b> &lt;<a href=3D"mailto:jwright AT comcast DOT net">=
jwright AT comcast DOT net
</a>&gt; wrote:</span><blockquote class=3D"gmail_quote" style=3D"border-lef=
t: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1=
ex;">philippe meynard wrote:<br>&gt; Hi! All<br>&gt;<br>&gt; do you know if=
 the function sprintf used dos call dpmi_int (0x21) or return
<br>&gt; the processor to the real mode or used malloc ?<br>&gt; Because I =
use LWP (multitasking library) and I have a crash on this function<br>&gt; =
sprintf !<br>&gt; I used sprintf like this :<br>&gt;<br>&gt; char chaf[100]=
;
<br>&gt; sprintf(chaf,&quot;%d\n&quot;,100);<br>&gt;<br>&gt;<br>&gt; Thanks=
.<br>&gt;<br>&gt;<br>&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;strin=
g.h&gt;<br><br>int main(void) {<br>&nbsp;&nbsp;&nbsp;&nbsp;char chaf[100];<=
br>&nbsp;&nbsp;&nbsp;&nbsp;sprintf(chaf, &quot;%d&quot;, 100);
<br>&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;chaf length is %d and looks like %=
s\n&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strlen(chaf), chaf);<br>=
&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>}<br><br>Can't guess your problem. The=
 above code works fine here.<br>--<br>Joe Wright<br>&quot;Everything should=
 be made as simple as possible, but not simpler.&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--- Albert Einstein ---<br></blockquote></div><br>

------=_Part_26729_25303838.1126134105680--

- Raw text -


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