From: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
To: Florian Fainelli <florian.fainelli@broadcom.com>,
linux-kernel@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
"open list:THERMAL" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] tools/thermal/tmon: Fix string truncation warning in optarg copy
Date: Wed, 7 Oct 2026 15:34:03 +0200 [thread overview]
Message-ID: <6e73ffc6-41ee-4ea0-a9e3-3286d6c72cb8@oss.qualcomm.com> (raw)
In-Reply-To: <20260929201951.408456-1-florian.fainelli@broadcom.com>
On 9/29/26 22:19, Florian Fainelli wrote:
> 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>
> ---
Applied, thanks
prev parent reply other threads:[~2026-10-07 13:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 20:19 [PATCH] tools/thermal/tmon: Fix string truncation warning in optarg copy Florian Fainelli
2026-10-07 13:34 ` Daniel Lezcano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e73ffc6-41ee-4ea0-a9e3-3286d6c72cb8@oss.qualcomm.com \
--to=daniel.lezcano@oss.qualcomm.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=daniel.lezcano@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=jacob.jun.pan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox