diff options
author | Elliott Hughes <enh@google.com> | 2015-04-29 12:28:13 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-04-30 12:31:11 -0700 |
commit | f1a58f8f33509201cabe71c6a9d01aa6b8f99966 (patch) | |
tree | f14e44638d2fdfde84b8a576c719fce757b96cf2 /adb/adb_client.h | |
parent | 0156589846117bccb2fbec6b3141cc21bc86c638 (diff) | |
download | system_core-f1a58f8f33509201cabe71c6a9d01aa6b8f99966.zip system_core-f1a58f8f33509201cabe71c6a9d01aa6b8f99966.tar.gz system_core-f1a58f8f33509201cabe71c6a9d01aa6b8f99966.tar.bz2 |
More fixed-length buffer removal.
Bug: http://b/20666660
Change-Id: I0c738e9fed2defed48a9cf2d0a4f7b99c08dcf3d
(cherry picked from commit 6452a89aa8934231e12ab77e0d90f12c3e892ad1)
Diffstat (limited to 'adb/adb_client.h')
-rw-r--r-- | adb/adb_client.h | 14 |
1 files changed, 6 insertions, 8 deletions
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. */ |