From 391c40b9ec4d91c76497c482115f2456e88c06dc Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Thu, 9 May 2019 12:55:41 -0700 Subject: [PATCH] NFC: Fix potentially uninitialized 'port' variable. Bug: http://b/131390872 Test: Builds with -Wconditional-uninitialized. Change-Id: Ie699ec39307fb3b66ade8248cdbe3d6de42533a7 --- adb/client/console.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/client/console.cpp b/adb/client/console.cpp index 1dbb6e248..d10f4deec 100644 --- a/adb/client/console.cpp +++ b/adb/client/console.cpp @@ -71,7 +71,7 @@ static int adb_get_emulator_console_port(const char* serial) { return -1; } - int port; + int port = -1; size_t emulator_count = 0; for (const auto& device : android::base::Split(devices, "\n")) { if (sscanf(device.c_str(), "emulator-%d", &port) == 1) {