From 0bbc764bbe8fc04eba1bf708fbf97526950cbeef Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 29 Mar 2017 23:57:47 -0700 Subject: updater: Don't append newline when calling uiPrint(). LOG(INFO) already appends a newline. Don't print redundant newline. Test: No extra blank lines when calling ui_print(). And on-screen UI shows the same. Change-Id: I74e9a8504a7146a6cb3dae02fe2406d0dd54069b --- updater/blockimg.cpp | 3 ++- updater/install.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index 8c0f885a1..4409cbefe 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1831,7 +1832,7 @@ Value* CheckFirstBlockFn(const char* name, State* state, uint16_t mount_count = *reinterpret_cast(&block0_buffer[0x400+0x34]); if (mount_count > 0) { - uiPrintf(state, "Device was remounted R/W %d times\n", mount_count); + uiPrintf(state, "Device was remounted R/W %" PRIu16 " times", mount_count); uiPrintf(state, "Last remount happened on %s", ctime(&mount_time)); } diff --git a/updater/install.cpp b/updater/install.cpp index f91f3fc9f..857d7f1e0 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -181,8 +181,8 @@ Value* MountFn(const char* name, State* state, const std::vector>& argv) { std::vector args; if (!ReadArgs(state, argv, &args)) { - return ErrorAbort(state, kArgsParsingFailure, "%s() Failed to parse the argument(s)", name); + return ErrorAbort(state, kArgsParsingFailure, "%s(): Failed to parse the argument(s)", name); } - std::string buffer = android::base::Join(args, "") + "\n"; + std::string buffer = android::base::Join(args, ""); uiPrint(state, buffer); return StringValue(buffer); } -- cgit v1.2.3