From: Dan Carpenter <error27@gmail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
Nick Kossifidis <mickflemm@gmail.com>,
Bob Copeland <me@bobcopeland.com>,
"John W. Linville" <linville@tuxdriver.com>,
Bruno Randolf <br1@einfach.org>,
linux-wireless@vger.kernel.org, ath5k-devel@lists.ath5k.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] ath5k: snprintf() returns largish values
Date: Thu, 22 Jul 2010 10:44:19 +0000 [thread overview]
Message-ID: <20100722104419.GZ17585@bicker> (raw)
In-Reply-To: <4C4807AD.5090302@gmail.com>
On Thu, Jul 22, 2010 at 10:56:13AM +0200, Jiri Slaby wrote:
> On 07/22/2010 10:52 AM, Dan Carpenter wrote:
> > snprintf() returns the number of characters that would have been written
> > (not counting the NUL character). So we can't use it as the limiter to
> > simple_read_from_buffer() without capping it first at sizeof(buf).
>
> Doesn't scnprintf make more sense here?
>
Not really... It's nice to pass a negative number as the buffer size to
snprintf() instead of having to make that a special case.
regards,
dan carpenter
> thanks,
> --
> js
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
Nick Kossifidis <mickflemm@gmail.com>,
Bob Copeland <me@bobcopeland.com>,
"John W. Linville" <linville@tuxdriver.com>,
Bruno Randolf <br1@einfach.org>,
linux-wireless@vger.kernel.org, ath5k-devel@lists.ath5k.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] ath5k: snprintf() returns largish values
Date: Thu, 22 Jul 2010 12:44:19 +0200 [thread overview]
Message-ID: <20100722104419.GZ17585@bicker> (raw)
In-Reply-To: <4C4807AD.5090302@gmail.com>
On Thu, Jul 22, 2010 at 10:56:13AM +0200, Jiri Slaby wrote:
> On 07/22/2010 10:52 AM, Dan Carpenter wrote:
> > snprintf() returns the number of characters that would have been written
> > (not counting the NUL character). So we can't use it as the limiter to
> > simple_read_from_buffer() without capping it first at sizeof(buf).
>
> Doesn't scnprintf make more sense here?
>
Not really... It's nice to pass a negative number as the buffer size to
snprintf() instead of having to make that a special case.
regards,
dan carpenter
> thanks,
> --
> js
next prev parent reply other threads:[~2010-07-22 10:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 8:52 [patch -next] ath5k: snprintf() returns largish values Dan Carpenter
2010-07-22 8:52 ` Dan Carpenter
2010-07-22 8:56 ` Jiri Slaby
2010-07-22 8:56 ` Jiri Slaby
2010-07-22 10:44 ` Dan Carpenter [this message]
2010-07-22 10:44 ` Dan Carpenter
2010-07-23 8:44 ` Bruno Randolf
2010-07-23 8:44 ` Bruno Randolf
2010-07-23 10:04 ` Dan Carpenter
2010-07-23 10:04 ` Dan Carpenter
2010-07-23 17:48 ` Joe Perches
2010-07-23 17:48 ` Joe Perches
2010-07-23 17:48 ` Joe Perches
2010-07-23 19:21 ` Linus Torvalds
2010-07-23 19:21 ` Linus Torvalds
2010-07-23 16:11 ` walter harms
2010-07-23 16:11 ` walter harms
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=20100722104419.GZ17585@bicker \
--to=error27@gmail.com \
--cc=ath5k-devel@lists.ath5k.org \
--cc=br1@einfach.org \
--cc=jirislaby@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=lrodriguez@atheros.com \
--cc=me@bobcopeland.com \
--cc=mickflemm@gmail.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.