All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Jinseok Kim" <always.starving0@gmail.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] inotify: replace strcpy() with snprintf()
Date: Wed, 18 Mar 2026 13:40:13 +0000	[thread overview]
Message-ID: <69baab3e.050a0220.20c44c.52e9@mx.google.com> (raw)
In-Reply-To: <20260317170058.1229-1-always.starving0@gmail.com>

Hi,

> 
> The -Wformat-truncation warning still occurs:
> 
>   snprintf(fname2, sizeof(fname2), "%s.rename1", fname1);
>   snprintf(fname3, sizeof(fname3), "%s.rename2", fname1);

Indeed, compiler might complains in this case.

`snprintf()` can't overflow, but it can stop adding characters after `PATH_MAX`.
We need to verify the return value, but `PATH_MAX` can be still a valid return
value. I will cc @Cyril to ask for an opinion about it.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-03-18 13:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01 16:57 [LTP] [PATCH] inotify: clean up build and make check findings Jinseok Kim
2026-03-03 15:46 ` Andrea Cervesato via ltp
2026-03-06  7:20   ` Jinseok Kim
2026-03-06 11:28     ` Cyril Hrubis
2026-03-09 14:48       ` Jinseok Kim
2026-03-13 16:05   ` [LTP] [PATCH v2 1/2] inotify: replace strcpy() with snprintf() Jinseok Kim
2026-03-13 16:05     ` [LTP] [PATCH v2 2/2] inotify: fix make check findings Jinseok Kim
2026-03-16 12:31       ` Andrea Cervesato via ltp
2026-05-12 15:38         ` Jinseok Kim
2026-03-16 12:30     ` [LTP] [PATCH v2 1/2] inotify: replace strcpy() with snprintf() Andrea Cervesato via ltp
2026-03-16 15:44       ` [LTP] [PATCH v3] " Jinseok Kim
2026-03-17  9:39         ` Andrea Cervesato via ltp
2026-03-17 17:00           ` Jinseok Kim
2026-03-18 13:40             ` Andrea Cervesato via ltp [this message]
2026-05-12 15:34               ` Jinseok Kim

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=69baab3e.050a0220.20c44c.52e9@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=always.starving0@gmail.com \
    --cc=andrea.cervesato@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.