Added a basic vsnprintf implementation to work around problems with compilers

that don't have it.
Added SB_VPrintf and SB_Printf as safe replacement for sprintf function
with the output going into a string buffer.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3327 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2004-12-15 21:23:22 +00:00
parent 569f57bc1b
commit e43766ea93
4 changed files with 626 additions and 26 deletions

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 2000 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* (C) 2000-2004 Ullrich von Bassewitz */
/* R<>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -51,13 +51,25 @@
int xvsnprintf (char* Buf, size_t Size, const char* Format, va_list ap)
attribute ((format (printf, 3, 0)));
/* A basic vsnprintf implementation. Does currently only support integer
* formats.
*/
int xsnprintf (char* Buf, size_t Size, const char* Format, ...)
attribute ((format (printf, 3, 4)));
/* A basic snprintf implementation. Does currently only support integer
* formats.
*/
int xsprintf (char* Buf, size_t BufSize, const char* Format, ...)
attribute ((format (printf, 3, 4)));
/* Replacement function for sprintf */
/* Replacement function for sprintf. Will FAIL on errors. */
int xvsprintf (char* Buf, size_t BufSize, const char* Format, va_list ap)
attribute ((format (printf, 3, 0)));
/* Replacement function for sprintf */
/* Replacement function for sprintf. Will FAIL on errors. */