[RFC,v3,2/2] manual/: Prefer aprintf(3) over asprintf(3)
Checks
Commit Message
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
manual/examples/rprintf.c | 4 ++--
manual/stdio.texi | 4 ++--
manual/string.texi | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
@@ -38,8 +38,8 @@ print_widget (FILE *stream,
/* Format the output into a string. */
w = *((const Widget **) (args[0]));
- len = asprintf (&buffer, "<Widget %p: %s>", w, w->name);
- if (len == -1)
+ buffer = aprintf ("<Widget %p: %s>", w, w->name);
+ if (buffer == NULL)
return -1;
/* Pad to the minimum field width and print to the stream. */
@@ -2458,7 +2458,7 @@ because it can potentially output more characters than can fit in the
allocation size of the string @var{s}. Remember that the field width
given in a conversion specification is only a @emph{minimum} value.
-To avoid this problem, you can use @code{snprintf} or @code{asprintf},
+To avoid this problem, you can use @code{snprintf} or @code{aprintf},
described below.
@end deftypefun
@@ -2543,7 +2543,7 @@ make_message (char *name, char *value)
@end group
@end smallexample
-In practice, it is often easier just to use @code{asprintf}, below.
+In practice, it is often easier just to use @code{aprintf}, below.
@strong{Attention:} In versions of @theglibc{} prior to 2.1 the
return value is the number of characters stored, not including the
@@ -1198,7 +1198,7 @@ strings to fit arbitrary size limits. @xref{Semantics, , Writing
Robust Programs, standards, The GNU Coding Standards}. Instead of
string-truncation functions, it is usually better to use dynamic
memory allocation (@pxref{Unconstrained Allocation}) and functions
-such as @code{strdup} or @code{asprintf} to construct strings.
+such as @code{strdup} or @code{aprintf} to construct strings.
@node String/Array Comparison
@section String/Array Comparison