From: Greg KH <gregkh@linuxfoundation.org>
To: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: fbtbt: show() methods should use scnprintf()
Date: Tue, 29 Sep 2015 21:38:03 +0200 [thread overview]
Message-ID: <20150929193803.GA23361@kroah.com> (raw)
In-Reply-To: <1443554123-15360-1-git-send-email-ksenija.stanojevic@gmail.com>
On Tue, Sep 29, 2015 at 09:15:23PM +0200, Ksenija Stanojevic wrote:
> snprintf() may return a value that exceeds its second argument,
> show() methods should use scnprintf() instead of snprintf().
>
> Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> ---
> drivers/staging/fbtft/fbtft-sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
> index 8d8bd12..36a1f4e 100644
> --- a/drivers/staging/fbtft/fbtft-sysfs.c
> +++ b/drivers/staging/fbtft/fbtft-sysfs.c
> @@ -198,7 +198,7 @@ static ssize_t show_debug(struct device *device,
> struct fb_info *fb_info = dev_get_drvdata(device);
> struct fbtft_par *par = fb_info->par;
>
> - return snprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
> + return scnprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
They should? Why? This shouldn't be needed at all, and really, a
simple sprintf() is all that is necessary. I would just leave this
alone, it's fine as-is.
thanks,
greg k-h
next prev parent reply other threads:[~2015-09-29 19:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 19:15 [PATCH] Staging: fbtbt: show() methods should use scnprintf() Ksenija Stanojevic
2015-09-29 19:38 ` Greg KH [this message]
2015-09-29 19:50 ` [Outreachy kernel] " Ksenija Stanojević
2015-09-29 20:12 ` Greg KH
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=20150929193803.GA23361@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ksenija.stanojevic@gmail.com \
--cc=outreachy-kernel@googlegroups.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.