summaryrefslogtreecommitdiffstats
path: root/adb/adb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adb/adb.cpp')
-rw-r--r--adb/adb.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/adb/adb.cpp b/adb/adb.cpp
index 11c65da..8a7b9c9 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -89,10 +89,8 @@ void start_device_log(void) {
char timestamp[PATH_MAX];
strftime(timestamp, sizeof(timestamp), "%Y-%m-%d-%H-%M-%S", &now);
- char path[PATH_MAX];
- snprintf(path, sizeof(path), "/data/adb/adb-%s-%d", timestamp, getpid());
-
- int fd = unix_open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0640);
+ std::string path = android::base::StringPrintf("/data/adb/adb-%s-%d", timestamp, getpid());
+ int fd = unix_open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0640);
if (fd == -1) {
return;
}