From 8a7f778c018fc67f6fdc7d9dca7f7ed53f7c7fdc Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 19 Aug 2015 13:53:20 -0700 Subject: [PATCH] logd: white and black switch to std::string (cherry pick commit from b332f1c427938453ae2c41fc96aad1ed8e461b65) Bug: 23350706 Change-Id: I92f21aee0a9702f63e8465851d0f35007b0469a7 --- logd/LogWhiteBlackList.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/logd/LogWhiteBlackList.cpp b/logd/LogWhiteBlackList.cpp index 16dd6d2f0..0406bf3d0 100644 --- a/logd/LogWhiteBlackList.cpp +++ b/logd/LogWhiteBlackList.cpp @@ -16,7 +16,9 @@ #include -#include +#include + +#include #include "LogWhiteBlackList.h" @@ -176,10 +178,10 @@ void PruneList::format(char **strp) { static const char nice_format[] = " %s"; const char *fmt = nice_format + 1; - android::String8 string; + std::string string; if (mWorstUidEnabled) { - string.setTo("~!"); + string = "~!"; fmt = nice_format; } @@ -189,7 +191,7 @@ void PruneList::format(char **strp) { char *a = NULL; (*it).format(&a); - string.appendFormat(fmt, a); + string += android::base::StringPrintf(fmt, a); fmt = nice_format; free(a); @@ -201,13 +203,13 @@ void PruneList::format(char **strp) { char *a = NULL; (*it).format(&a); - string.appendFormat(fmt, a); + string += android::base::StringPrintf(fmt, a); fmt = naughty_format; free(a); } - *strp = strdup(string.string()); + *strp = strdup(string.c_str()); } // ToDo: Lists are in sorted order, Prune->cmp() returns + or -