From: David Miller <davem@davemloft.net>
To: linux@roeck-us.net
Cc: isdn@linux-pingi.de, keescook@chromium.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] TTY: isdn: Replace strncpy with memcpy
Date: Mon, 02 Jul 2018 22:43:05 +0900 (KST) [thread overview]
Message-ID: <20180702.224305.2266842641209029592.davem@davemloft.net> (raw)
In-Reply-To: <1530478658-23070-1-git-send-email-linux@roeck-us.net>
From: Guenter Roeck <linux@roeck-us.net>
Date: Sun, 1 Jul 2018 13:57:38 -0700
> gcc 8.1.0 complains:
>
> drivers/isdn/i4l/isdn_tty.c: In function 'isdn_tty_suspend.isra.1':
> drivers/isdn/i4l/isdn_tty.c:790:3: warning:
> 'strncpy' output truncated before terminating nul copying
> as many bytes from a string as its length
> drivers/isdn/i4l/isdn_tty.c:778:6: note: length computed here
>
> drivers/isdn/i4l/isdn_tty.c: In function 'isdn_tty_resume':
> drivers/isdn/i4l/isdn_tty.c:880:3: warning:
> 'strncpy' output truncated before terminating nul copying
> as many bytes from a string as its length
> drivers/isdn/i4l/isdn_tty.c:817:6: note: length computed here
>
> Using strncpy() is indeed less than perfect since the length of data to
> be copied has already been determined with strlen(). Replace strncpy()
> with memcpy() to address the warning and optimize the code a little.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Applied.
prev parent reply other threads:[~2018-07-02 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-01 20:57 [PATCH] TTY: isdn: Replace strncpy with memcpy Guenter Roeck
2018-07-02 13:43 ` David Miller [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=20180702.224305.2266842641209029592.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=isdn@linux-pingi.de \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
/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