From f1a58f8f33509201cabe71c6a9d01aa6b8f99966 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 29 Apr 2015 12:28:13 -0700 Subject: More fixed-length buffer removal. Bug: http://b/20666660 Change-Id: I0c738e9fed2defed48a9cf2d0a4f7b99c08dcf3d (cherry picked from commit 6452a89aa8934231e12ab77e0d90f12c3e892ad1) --- adb/adb_client.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'adb/adb_client.h') diff --git a/adb/adb_client.h b/adb/adb_client.h index 5ce7080..96416f5 100644 --- a/adb/adb_client.h +++ b/adb/adb_client.h @@ -9,19 +9,17 @@ ** a valid fd for interacting with that service upon success ** or a negative number on failure */ -int adb_connect(const char* service, std::string* error); -int _adb_connect(const char* service, std::string* error); +int adb_connect(const std::string& service, std::string* error); +int _adb_connect(const std::string& service, std::string* error); /* connect to adb, connect to the named service, return 0 if ** the connection succeeded AND the service returned OKAY */ -int adb_command(const char* service, std::string* error); +int adb_command(const std::string& service, std::string* error); -/* connect to adb, connect to the named service, return -** a malloc'd string of its response upon success or NULL -** on failure. -*/ -char* adb_query(const char* service, std::string* error); +// Connects to the named adb service and fills 'result' with the response. +// Returns true on success; returns false and fills 'error' on failure. +bool adb_query(const std::string& service, std::string* result, std::string* error); /* Set the preferred transport to connect to. */ -- cgit v1.1