summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/LICENSES1
-rw-r--r--payloads/libpayload/include/libpayload.h1
-rw-r--r--payloads/libpayload/libc/printf.c12
3 files changed, 14 insertions, 0 deletions
diff --git a/payloads/libpayload/LICENSES b/payloads/libpayload/LICENSES
index 2fb6e5d3a8..8882409f36 100644
--- a/payloads/libpayload/LICENSES
+++ b/payloads/libpayload/LICENSES
@@ -78,6 +78,7 @@ holders, and the exact license terms that apply.
svn checkout svn://svn.helenos.eu/HelenOS/trunk HelenOS
http://svn.helenos.eu/chora/browse.php?f=%2Ftrunk%2F
Original files: kernel/generic/src/printf/printf_core.c
+ kernel/generic/src/printf/snprintf.c
kernel/generic/src/printf/sprintf.c
kernel/generic/src/printf/vsnprintf.c
kernel/generic/src/printf/vsprintf.c
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 251c79f257..fb3403a005 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -110,6 +110,7 @@ void *memmove(void *dst, const void *src, size_t n);
int memcmp(const char *s1, const char *s2, size_t len);
/* libc/printf.c */
+int snprintf(char *str, size_t size, const char *fmt, ...);
int sprintf(char *str, const char *fmt, ...);
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap);
int vsprintf(char *str, const char *fmt, va_list ap);
diff --git a/payloads/libpayload/libc/printf.c b/payloads/libpayload/libc/printf.c
index 71c7654dbb..062879c523 100644
--- a/payloads/libpayload/libc/printf.c
+++ b/payloads/libpayload/libc/printf.c
@@ -694,6 +694,18 @@ out:
return counter;
}
+int snprintf(char *str, size_t size, const char *fmt, ...)
+{
+ int ret;
+ va_list args;
+
+ va_start(args, fmt);
+ ret = vsnprintf(str, size, fmt, args);
+ va_end(args);
+
+ return ret;
+}
+
int sprintf(char *str, const char *fmt, ...)
{
int ret;