summaryrefslogtreecommitdiffstats
path: root/src/core/vsprintf.c
diff options
context:
space:
mode:
authorMichael Brown2006-04-30 14:01:31 +0200
committerMichael Brown2006-04-30 14:01:31 +0200
commita42092d2a05bbaf102121e655b5b4c240c8f8e8e (patch)
tree6ee6ce9bb1b77e22035056077e6c0acb2edb0c28 /src/core/vsprintf.c
parentFix up prototype of strtoul() to match POSIX. (diff)
downloadipxe-a42092d2a05bbaf102121e655b5b4c240c8f8e8e.tar.gz
ipxe-a42092d2a05bbaf102121e655b5b4c240c8f8e8e.tar.xz
ipxe-a42092d2a05bbaf102121e655b5b4c240c8f8e8e.zip
Add a temporary snprintf, so that safely-written code can at least
compile, even if it won't yet be safe.
Diffstat (limited to 'src/core/vsprintf.c')
-rw-r--r--src/core/vsprintf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/vsprintf.c b/src/core/vsprintf.c
index e3ff7d9d..3c8e5b5c 100644
--- a/src/core/vsprintf.c
+++ b/src/core/vsprintf.c
@@ -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.
*