summaryrefslogtreecommitdiff
path: root/src/include/string.h
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2013-11-26 22:07:47 +0100
committerPeter Stuge <peter@stuge.se>2014-01-10 14:13:23 +0100
commit4b5012a4a2bf804d395ae3a72c76f50c4a9189db (patch)
tree1f2624a6fd80ebf9238d406f3535ea1f382a87f6 /src/include/string.h
parent697c1ed1ff93c3da040dd4bff0cbd1886bd5bf05 (diff)
downloadcoreboot-4b5012a4a2bf804d395ae3a72c76f50c4a9189db.tar.xz
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>
Diffstat (limited to 'src/include/string.h')
-rw-r--r--src/include/string.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/string.h b/src/include/string.h
index 77985e1325..dc125e19b0 100644
--- a/src/include/string.h
+++ b/src/include/string.h
@@ -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