Mail Archives: djgpp/2000/01/05/19:49:18
Peter Allen (P DOT Allen AT pallen DOT dabsol DOT co DOT uk) wrote:
: -------- Original Message --------
: Subject: Any snprintf in djgpp?
: Date: Mon, 03 Jan 2000 21:56:38 +0000
: From: Peter Allen <P DOT Allen AT pallen DOT dabsol DOT co DOT uk>
: To: djgpp AT delorie DOT com
: Is there an implementation of snprintf or similar in djgpp?
: If not I think it would be a good thing to add, as sprintf does
: not guard against buffer overuns.
: For those that have not come across it, snprintf, prototype
: int snprintf(char *str, size_t str_m, const char *fmt,...);
: does exactly the same as sprintf but stops buffer overun
: by having the additional argument size_t str_m.
: I guess it would not be difficult to modify the existing sprintf
: code, although for reference there is a gpl'd implementation here:
: http://www.ijs.si/software/snprintf/
: although of course being gpl'd it could not be included in libc.
Ho ! Thanks for the reminder, I wanted to that, and somehow things got shift
And with memory fading ....
Suprisingly snprintf(5 lines) is quite trivial to incorparte to DJGPP
since all the machinery is already in place. However there were
some things that did not work correctly, I would have to dig ...
Hopefully this time memory will hold.
If you need a LGPL version, I wrote one long long time ago ...
I think it is still available at :
ftp://mccoy.ee.mcgill.ca/pub/alain/misc/snprintf/snprintf-1.2.tar.gz
It has been use in many commercial and non-commercial software
--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!
- Raw text -