]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_selftest/efi_selftest_console.c
efi_selftest: do not cut off u16 strings when printing
[u-boot] / lib / efi_selftest / efi_selftest_console.c
index 6a7fd20da5c51b008fd0794b07c96345c50225cc..963ed913db320187c598f79c5a9b8ad0733b04d2 100644 (file)
@@ -142,7 +142,7 @@ void efi_st_printf(const char *fmt, ...)
        const char *c;
        u16 *pos = buf;
        const char *s;
-       const u16 *u;
+       u16 *u;
 
        va_start(args, fmt);
 
@@ -188,9 +188,13 @@ void efi_st_printf(const char *fmt, ...)
                                /* u16 string */
                                case 's':
                                        u = va_arg(args, u16*);
-                                       /* Ensure string fits into buffer */
-                                       for (; *u && pos < buf + 120; ++u)
-                                               *pos++ = *u;
+                                       if (pos > buf) {
+                                               *pos = 0;
+                                               con_out->output_string(con_out,
+                                                                      buf);
+                                       }
+                                       con_out->output_string(con_out, u);
+                                       pos = buf;
                                        break;
                                default:
                                        --c;