console/vsprintf: Implement snprintf
snprintf is a safe variant of sprintf. To avoid buffer overflows we shouldn't use sprintf at all. But for now let's start by implementing snprintf in first place. Change-Id: Ic17d94b8cd91b72f66b84b0589a06b8abef5e5c9 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4278 Tested-by: build bot (Jenkins) Reviewed-by: Peter Stuge <peter@stuge.se>
This commit is contained in:
committed by
Peter Stuge
parent
697c1ed1ff
commit
4b5012a4a2
@ -17,6 +17,7 @@ int memcmp(const void *s1, const void *s2, size_t n);
|
||||
void *memchr(const void *s, int c, size_t n);
|
||||
#if !defined(__PRE_RAM__)
|
||||
int sprintf(char * buf, const char *fmt, ...);
|
||||
int snprintf(char * buf, size_t size, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
// simple string functions
|
||||
|
Reference in New Issue
Block a user