diff options
| author | Florian Fainelli <florian.fainelli@broadcom.com> | 2026-09-29 13:19:51 -0700 |
|---|---|---|
| committer | Daniel Lezcano <daniel.lezcano@kernel.org> | 2026-10-14 09:45:40 +0200 |
| commit | 602da762f7a7c494a95cb204ac005965b214e556 (patch) | |
| tree | 1d8f8f1ee2d0ce28f61c39c829bd3d10813b9bb7 /tools/perf/scripts/python | |
| parent | 06a169d840a0d6ce03c230b115cef7d7cebcc2d4 (diff) | |
tools/thermal/tmon: Fix string truncation warning in optarg copy
GCC warns about possible string truncation with -Wstringop-truncation:
tmon.c: In function ‘main’:
tmon.c:233:25: warning: ‘__builtin_strncpy’ specified bound 20 equals
destination size [-Wstringop-truncation]
233 | strncpy(ctrl_cdev, optarg,
CDEV_NAME_SIZE);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Replace strncpy() with snprintf() to guarantee NUL-termination and
silence the compiler warning.
Fixes: 94f69966faf8 ("tools/thermal: Introduce tmon, a tool for thermal subsystem")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260929201951.408456-1-florian.fainelli@broadcom.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
