From 596b342a0476629badb41b840494254a19c57dae Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 14 May 2013 11:03:02 -0700 Subject: recovery: turn on text display for install errors in debug builds Hopefully this will reduce the number of OTA "bugs" reported that are really just someone having changed their system partition, invalidating future incremental OTAs. Also fixes a longstanding TODO about putting LOGE() output in the on-screen display. Change-Id: I44e5be65b2dee7ebce2cce28ccd920dc3d6e522e --- verifier_test.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'verifier_test.cpp') diff --git a/verifier_test.cpp b/verifier_test.cpp index 7fab54748..1063cbae5 100644 --- a/verifier_test.cpp +++ b/verifier_test.cpp @@ -18,6 +18,7 @@ #include #include +#include "common.h" #include "verifier.h" #include "ui.h" #include "mincrypt/sha.h" @@ -115,13 +116,10 @@ class FakeUI : public RecoveryUI { bool IsTextVisible() { return false; } bool WasTextEverVisible() { return false; } void Print(const char* fmt, ...) { - char buf[256]; va_list ap; va_start(ap, fmt); - vsnprintf(buf, 256, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - - fputs(buf, stderr); } void StartMenu(const char* const * headers, const char* const * items, @@ -130,6 +128,14 @@ class FakeUI : public RecoveryUI { void EndMenu() { } }; +void +ui_print(const char* format, ...) { + va_list ap; + va_start(ap, format); + vfprintf(stdout, format, ap); + va_end(ap); +} + int main(int argc, char **argv) { if (argc < 2 || argc > 4) { fprintf(stderr, "Usage: %s [-sha256] [-f4 | -file ] \n", argv[0]); -- cgit v1.2.3