mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jiri Kosina <trivial@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Will Schmidt <will_schmidt@vnet.ibm.com>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Milton Miller <miltonm@bga.com>
Subject: Re: [PATCH v2] trivial: make comment about vs{n,cn,}printf more understandable
Date: Wed, 6 Apr 2011 16:34:41 +0200	[thread overview]
Message-ID: <20110406143441.GE13963@pengutronix.de> (raw)
In-Reply-To: <1290625833-32576-1-git-send-email-u.kleine-koenig@pengutronix.de>

Hello Jiri,

On Wed, Nov 24, 2010 at 08:10:33PM +0100, Uwe Kleine-König wrote:
> "You probably want ... instead." sounds like a recommendation better
> not to use the v... functions.
you didn't take this patch. Did you skip it on purpose?

Best regards
Uwe

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> this is Milton's alternative suggestion plus an added "using".
> 
> Thanks
> Uwe
> 
>  lib/vsprintf.c |    9 +++------
>  1 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index c150d3d..6c46e0f 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -1279,8 +1279,7 @@ qualifier:
>   * return is greater than or equal to @size, the resulting
>   * string is truncated.
>   *
> - * Call this function if you are already dealing with a va_list.
> - * You probably want snprintf() instead.
> + * If you're not already dealing with a va_list consider using snprintf().
>   */
>  int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
>  {
> @@ -1454,8 +1453,7 @@ EXPORT_SYMBOL(vsnprintf);
>   * the @buf not including the trailing '\0'. If @size is <= 0 the function
>   * returns 0.
>   *
> - * Call this function if you are already dealing with a va_list.
> - * You probably want scnprintf() instead.
> + * If you're not already dealing with a va_list consider using scnprintf().
>   *
>   * See the vsnprintf() documentation for format string extensions over C99.
>   */
> @@ -1534,8 +1532,7 @@ EXPORT_SYMBOL(scnprintf);
>   * into @buf. Use vsnprintf() or vscnprintf() in order to avoid
>   * buffer overflows.
>   *
> - * Call this function if you are already dealing with a va_list.
> - * You probably want sprintf() instead.
> + * If you're not already dealing with a va_list consider using sprintf().
>   *
>   * See the vsnprintf() documentation for format string extensions over C99.
>   */
> -- 
> 1.7.2.3
> 
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2011-04-06 14:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 16:12 [PATCH] " Uwe Kleine-König
2010-11-24  3:04 ` Milton Miller
2010-11-24  3:20   ` Steven Rostedt
2010-11-24 15:27     ` Will Schmidt
2010-11-24 19:10   ` [PATCH v2] " Uwe Kleine-König
2011-04-06 14:34     ` Uwe Kleine-König [this message]
2011-04-06 14:37       ` Jiri Kosina

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=20110406143441.GE13963@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miltonm@bga.com \
    --cc=rdunlap@xenotime.net \
    --cc=rostedt@goodmis.org \
    --cc=trivial@kernel.org \
    --cc=will_schmidt@vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome