提交 ba1835eb 编写于 作者: U Uwe Kleine-König 提交者: Jiri Kosina

vsprintf: make comment about vs{n,cn,}printf more understandable

"You probably want ... instead." sounds like a recommendation better
not to use the v... functions.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 5a3016a6
...@@ -1301,8 +1301,7 @@ int format_decode(const char *fmt, struct printf_spec *spec) ...@@ -1301,8 +1301,7 @@ int format_decode(const char *fmt, struct printf_spec *spec)
* return is greater than or equal to @size, the resulting * return is greater than or equal to @size, the resulting
* string is truncated. * string is truncated.
* *
* Call this function if you are already dealing with a va_list. * If you're not already dealing with a va_list consider using snprintf().
* You probably want snprintf() instead.
*/ */
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
{ {
...@@ -1476,8 +1475,7 @@ EXPORT_SYMBOL(vsnprintf); ...@@ -1476,8 +1475,7 @@ EXPORT_SYMBOL(vsnprintf);
* the @buf not including the trailing '\0'. If @size is == 0 the function * the @buf not including the trailing '\0'. If @size is == 0 the function
* returns 0. * returns 0.
* *
* Call this function if you are already dealing with a va_list. * If you're not already dealing with a va_list consider using scnprintf().
* You probably want scnprintf() instead.
* *
* See the vsnprintf() documentation for format string extensions over C99. * See the vsnprintf() documentation for format string extensions over C99.
*/ */
...@@ -1556,8 +1554,7 @@ EXPORT_SYMBOL(scnprintf); ...@@ -1556,8 +1554,7 @@ EXPORT_SYMBOL(scnprintf);
* into @buf. Use vsnprintf() or vscnprintf() in order to avoid * into @buf. Use vsnprintf() or vscnprintf() in order to avoid
* buffer overflows. * buffer overflows.
* *
* Call this function if you are already dealing with a va_list. * If you're not already dealing with a va_list consider using sprintf().
* You probably want sprintf() instead.
* *
* See the vsnprintf() documentation for format string extensions over C99. * See the vsnprintf() documentation for format string extensions over C99.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册