Make android_logger_set_prune_list() sane

The current version requires callers to supply a string with 32 extra
bytes for liblog to internally prepend "setPruneList ", and to have
enough space to parse logd's return string.  That is an unacceptable
requirement on callers.

This change removes that requirement by having liblog allocate the
needed std::string in any case.

It also stops writing back the 'success' or 'Invalid' string to the
caller's buffer, since that is redundant as well.

Test: changing prune settings works.
Change-Id: Ic0f03a229f0b9a77d03adcb91288370c3bd42903
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index 831b4e3..cd5d7d4 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -1075,17 +1075,8 @@
 
     if (setPruneList) {
         size_t len = strlen(setPruneList);
-        // extra 32 bytes are needed by android_logger_set_prune_list
-        size_t bLen = len + 32;
-        char* buf = nullptr;
-        if (asprintf(&buf, "%-*s", (int)(bLen - 1), setPruneList) > 0) {
-            buf[len] = '\0';
-            if (android_logger_set_prune_list(logger_list.get(), buf, bLen)) {
-                error(EXIT_FAILURE, 0, "Failed to set the prune list.");
-            }
-            free(buf);
-        } else {
-            error(EXIT_FAILURE, 0, "Failed to set the prune list (alloc).");
+        if (android_logger_set_prune_list(logger_list.get(), setPruneList, len)) {
+            error(EXIT_FAILURE, 0, "Failed to set the prune list.");
         }
         return EXIT_SUCCESS;
     }