From: Nick Desaulniers <nick.desaulniers@gmail.com>
To: b.zolnierkie@samsung.com
Cc: Nick Desaulniers <nick.desaulniers@gmail.com>,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] video/hdmi: prefer strlcpy to strncpy
Date: Tue, 29 May 2018 06:59:05 +0000 [thread overview]
Message-ID: <1527577145-7750-1-git-send-email-nick.desaulniers@gmail.com> (raw)
Fixes a stringop-truncation warning from gcc-8.
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
drivers/video/hdmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 111a0ab..46c184c 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -168,8 +168,8 @@ int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame,
frame->version = 1;
frame->length = HDMI_SPD_INFOFRAME_SIZE;
- strncpy(frame->vendor, vendor, sizeof(frame->vendor));
- strncpy(frame->product, product, sizeof(frame->product));
+ strlcpy(frame->vendor, vendor, sizeof(frame->vendor));
+ strlcpy(frame->product, product, sizeof(frame->product));
return 0;
}
--
2.7.4
next reply other threads:[~2018-05-29 6:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 6:59 Nick Desaulniers [this message]
2018-05-30 1:58 ` [PATCH] video/hdmi: prefer strlcpy to strncpy Nick Desaulniers
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=1527577145-7750-1-git-send-email-nick.desaulniers@gmail.com \
--to=nick.desaulniers@gmail.com \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).