Message-ID: <38733A75.4D841D0B@pallen.dabsol.co.uk> Date: Wed, 05 Jan 2000 12:35:01 +0000 From: Peter Allen
X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Any snprintf in djgpp? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com -------- Original Message -------- Subject: Any snprintf in djgpp? Date: Mon, 03 Jan 2000 21:56:38 +0000 From: Peter Allen
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. Peter Allen