delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/11/03/16:10:44

Message-Id: <200011032106.QAA17762@qnx.com>
Subject: Re: snprintf
To: djgpp-workers AT delorie DOT com
Date: Fri, 3 Nov 2000 16:06:21 -0500 (EST)
From: "Alain Magloire" <alain AT qnx DOT com>
In-Reply-To: <3A028E7D.10717.AF2EF@localhost> from "Mark E." at Nov 03, 2000 10:07:57 AM
X-Mailer: ELM [version 2.5 PL0b1]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 
> > Well, I guess the author of this library might be inclined to make an
> > exception for DJGPP. Might be worth asking if this saves the DJGPP
> > team the work of reimplementing these functions.
> > 
> 
> An implementation of snprintf was posted some time ago. See 
> http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp-
> workers/1999/06/09/16:04:27 .
> 

hmmm ....
Yes, I forgot about that.  It was change somewhat to comply
to C99 snprintf/vsnprintf semantics,  I've sent the docs and patches
to Eli, but that was along time ago.  It was suppose to be
in V2.03 ? or something.  The good thing is that it reused
DJGPP stdio guts but some small cosmetic changes was supposed
to be done on _doprnt() or __putc() to make it aware of the
size of the buffer, after that writing v/snprintf() was trivial,
a few lines of code.

Sorry, I could not find trace of the patches in my $HOME.

The other interresting thing was to have a FILE * memory buffer
GNU lib C will/is provide(ing) the necessary hooks for this
fmemopen() and friends

In any case the stdio guts (_doprnt() and friends) should
pay attention not to overflow its buffer.  Once that is
done vsnpritf is trivial and maybe other things can be added.


-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!

- Raw text -


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