summaryrefslogtreecommitdiffstats
path: root/src/core/vsprintf.c
diff options
context:
space:
mode:
authorMichael Brown2006-03-16 18:40:55 +0100
committerMichael Brown2006-03-16 18:40:55 +0100
commit708bbc43bca286bb30f9376f346adf51e62f04c4 (patch)
treefe7b7062d60de9c58b5b6ce31db288d6223d7aee /src/core/vsprintf.c
parentMerge from Etherboot 5.4 (diff)
parentImport from Etherboot 5.4 (diff)
downloadipxe-708bbc43bca286bb30f9376f346adf51e62f04c4.tar.gz
ipxe-708bbc43bca286bb30f9376f346adf51e62f04c4.tar.xz
ipxe-708bbc43bca286bb30f9376f346adf51e62f04c4.zip
Merge from Etherboot 5.4
Diffstat (limited to 'src/core/vsprintf.c')
-rw-r--r--src/core/vsprintf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/vsprintf.c b/src/core/vsprintf.c
index fda0e96c..83a494a6 100644
--- a/src/core/vsprintf.c
+++ b/src/core/vsprintf.c
@@ -45,7 +45,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args)
while (*fmt >= '0' && *fmt <= '9')
fmt++;
if (*fmt == 's') {
- for(p = va_arg(args, char *); *p != '\0'; p++)
+ for(p = va_arg(args, char *); *p != '\0'; p++)
buf ? *s++ = *p : putchar(*p);
} else if (*fmt == 'm') {
for(p = strerror(errno); *p != '\0'; p++)
@@ -70,7 +70,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args)
fmt++;
}
}
-
+
/*
* Before each format q points to tmp buffer
* After each format q points past end of item
@@ -182,11 +182,12 @@ int sprintf(char *buf, const char *fmt, ...)
* @err None -
*
*/
-void printf(const char *fmt, ...)
+int printf(const char *fmt, ...)
{
va_list args;
int i;
va_start(args, fmt);
i=vsprintf(0, fmt, args);
va_end(args);
+ return i;
}