From da5241cb1591416d6aeba9f30ce395b58c97cb5d Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Wed, 17 May 2017 15:34:22 +0100 Subject: Introduce `tf_snprintf` This is a reduced version of `snprintf` that only supports formats '%d', '%i' and '%u'. It can be used when the full `snprintf` is not needed in order to save memory. If it finds an unknown format specifier, it prints an error message and panics. Change-Id: I2cb06fcdf74cda2c43caf73ae0762a91499fc04e Signed-off-by: Antonio Nino Diaz --- include/common/debug.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/common/debug.h b/include/common/debug.h index 646dabaf..814cf840 100644 --- a/include/common/debug.h +++ b/include/common/debug.h @@ -64,6 +64,7 @@ void __dead2 do_panic(void); void __dead2 __stack_chk_fail(void); void tf_printf(const char *fmt, ...) __printflike(1, 2); +int tf_snprintf(char *s, size_t n, const char *fmt, ...) __printflike(3, 4); #endif /* __ASSEMBLY__ */ #endif /* __DEBUG_H__ */ -- cgit v1.2.3