summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-12-04 13:43:49 +0100
committerAlejandro Colomar <alx@kernel.org>2023-12-04 13:43:49 +0100
commit4f952642b6afcf6471bac9fe15ffe8e6c429b084 (patch)
tree4682d861e79c9286e9babc1a97fff7823119c3bd
parent059c39a5502f876230319a5089d77e26dcf273de (diff)
string_copying.7: Use fwrite(3) to print character sequences
Suggested-by: Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man7/string_copying.74
1 files changed, 2 insertions, 2 deletions
diff --git a/man7/string_copying.7 b/man7/string_copying.7
index 31dd2cb8b..de8b49471 100644
--- a/man7/string_copying.7
+++ b/man7/string_copying.7
@@ -652,7 +652,7 @@ char buf[NITEMS(u->ut_user)];
p = buf;
p = mempcpy(p, u->ut_user, strnlen(u->ut_user, NITEMS(u->ut_user)));
len = p \- buf;
-printf("%.*s\en", (int) len, buf);
+fwrite(buf, 1, len, stdout);
.EE
.\" ----- EXAMPLES :: stpcpy(mempcpy(dst, src, strnlen(src, NITEMS(src))), "")
.TP
@@ -684,7 +684,7 @@ p = mempcpy(p, "Hello ", 6);
p = mempcpy(p, "world", 5);
p = mempcpy(p, "!", 1);
len = p \- buf;
-printf("%.*s\en", (int) len, buf);
+fwrite(buf, 1, len, stdout);
.EE
.\" ----- EXAMPLES :: stpcpy(mempcpy(), "") ---------------------------/
.TP