[Lldb-commits] [lldb] [LLDB][NFC] Fix a cppcheck warning in lldb/source/Host/linux/Host.cpp (PR #94783)

via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 7 11:09:32 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Shivam Gupta (xgupta)

<details>
<summary>Changes</summary>

Fix #<!-- -->89710

---
Full diff: https://github.com/llvm/llvm-project/pull/94783.diff


1 Files Affected:

- (modified) lldb/source/Host/linux/Host.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp
index c6490f2fc9e2f..8a65c46a52ea8 100644
--- a/lldb/source/Host/linux/Host.cpp
+++ b/lldb/source/Host/linux/Host.cpp
@@ -92,7 +92,7 @@ static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo &ProcessInfo,
     return false;
   StatFields stat_fields;
   if (sscanf(Rest.data(),
-             "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %ld %ld",
+             "%d %15s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %ld %ld",
              &stat_fields.pid, stat_fields.comm, &stat_fields.state,
              &stat_fields.ppid, &stat_fields.pgrp, &stat_fields.session,
              &stat_fields.tty_nr, &stat_fields.tpgid, &stat_fields.flags,

``````````

</details>


https://github.com/llvm/llvm-project/pull/94783


More information about the lldb-commits mailing list