david/ipxe
Archived
1
0

Add a temporary snprintf, so that safely-written code can at least

compile, even if it won't yet be safe.
This commit is contained in:
Michael Brown 2006-04-30 12:01:31 +00:00
parent 8df7e74990
commit a42092d2a0
2 changed files with 12 additions and 0 deletions

View File

@ -173,6 +173,17 @@ int sprintf(char *buf, const char *fmt, ...)
return i;
}
#warning "Remove this buffer-overflow-in-waiting at some point"
int snprintf ( char *buf, size_t size, const char *fmt, ... ) {
va_list args;
int i;
va_start ( args, fmt );
i = vsprintf ( buf, fmt, args );
va_end ( args );
return i;
}
/**
* Write a formatted string to the console.
*

View File

@ -45,6 +45,7 @@
*/
extern int sprintf ( char *buf, const char *fmt, ... );
extern int snprintf ( char *buf, size_t size, const char *fmt, ... );
extern int printf ( const char *fmt, ... );
#endif /* VSPRINTF_H */