Add missing snprintf() to libc/printf.c (trivial).
[coreboot.git] / payloads / libpayload / libc / printf.c
index 8be713c1ef5bb00748e0a1325668ff7cdd76edfa..062879c523954421b608a2a87593d8911337d4cb 100644 (file)
@@ -279,8 +279,8 @@ static int print_number(uint64_t num, int width, int precision, int base,
                flags &= ~__PRINTF_FLAG_ZEROPADDED;
 
        /*
-        * If the number is leftaligned or precision is specified then
-        * zeropadding is ignored.
+        * If the number is left-aligned or precision is specified then
+        * zero-padding is ignored.
         */
        if (flags & __PRINTF_FLAG_ZEROPADDED) {
                if ((precision == 0) && (width > size))
@@ -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;