aboutsummaryrefslogtreecommitdiffstats
path: root/man3/printf.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-05-03 00:48:14 +0200
committerAlejandro Colomar <alx@kernel.org>2023-05-03 00:48:22 +0200
commitfe5dba139dc089eae4061fdc17f087e71f48b198 (patch)
tree54af56b1b0138bde9a21e99372ab68ce4d64564a /man3/printf.3
parent5a0d9ed151e6449d978fabdd654cacc17b20a235 (diff)
downloadman-pages-fe5dba139dc089eae4061fdc17f087e71f48b198.tar.gz
man*/, man.ignore.grep: srcfix; warn about blank lines
- Use the dummy character to avoid warnings in examples. - Re-enable the warning. Suggested-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man3/printf.3')
-rw-r--r--man3/printf.316
1 files changed, 8 insertions, 8 deletions
diff --git a/man3/printf.3 b/man3/printf.3
index b90a712938..962881a9cb 100644
--- a/man3/printf.3
+++ b/man3/printf.3
@@ -1192,7 +1192,7 @@ To allocate a sufficiently large string and print into it
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
-
+\&
char *
make_message(const char *fmt, ...)
{
@@ -1200,30 +1200,30 @@ make_message(const char *fmt, ...)
size_t size = 0;
char *p = NULL;
va_list ap;
-
+\&
/* Determine required size. */
-
+\&
va_start(ap, fmt);
n = vsnprintf(p, size, fmt, ap);
va_end(ap);
-
+\&
if (n < 0)
return NULL;
-
+\&
size = (size_t) n + 1; /* One extra byte for \[aq]\e0\[aq] */
p = malloc(size);
if (p == NULL)
return NULL;
-
+\&
va_start(ap, fmt);
n = vsnprintf(p, size, fmt, ap);
va_end(ap);
-
+\&
if (n < 0) {
free(p);
return NULL;
}
-
+\&
return p;
}
.EE