[Lldb-commits] [lldb] [LLDB][NFC] Fix a cppcheck warning in Platform/Android/PlatformAndroid.cpp (PR #94785)

Shivam Gupta via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 7 11:17:00 PDT 2024


https://github.com/xgupta created https://github.com/llvm/llvm-project/pull/94785



Fix #91211

>From 6ec5b1a005b7551f2857b30e2461d297e7febfa3 Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivam98.tkg at gmail.com>
Date: Fri, 7 Jun 2024 23:44:49 +0530
Subject: [PATCH] [LLDB][NFC] Fix a cppcheck warning in
 Platform/Android/PlatformAndroid.cpp

Fix #91211
---
 lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index e177c134fea20..6367763dd8b4a 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -287,7 +287,7 @@ Status PlatformAndroid::DownloadModuleSlice(const FileSpec &src_file_spec,
   static constexpr llvm::StringLiteral k_zip_separator("!/");
   size_t pos = source_file.find(k_zip_separator);
   if (pos != std::string::npos)
-    source_file = source_file.substr(0, pos);
+    source_file = source_file.resize(0, pos);
 
   Status error;
   AdbClientUP adb(GetAdbClient(error));



More information about the lldb-commits mailing list