summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-12-17 13:41:22 +0100
committerAlejandro Colomar <alx@kernel.org>2023-12-17 13:41:24 +0100
commit5d181d9ef84be3db802236c071fb15d2bc354664 (patch)
tree67eca660752f1c3d22f62782816429a6b3b0a1ba
parent39b26ae2036ff051f8109ad250ab507fd01f91f0 (diff)
string_copying.7: EXAMPLES: Update stpecpy() example
The function was changed recently to return NULL on truncation; update the example of use accordingly. 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 daf9723e8..3eb345d43 100644
--- a/man7/string_copying.7
+++ b/man7/string_copying.7
@@ -607,8 +607,8 @@ p = buf;
p = stpecpy(p, end, "Hello ");
p = stpecpy(p, end, "world");
p = stpecpy(p, end, "!");
-if (p == end) {
- p\-\-;
+if (p == NULL) {
+ len = sizeof(buf) \- 1;
goto toolong;
}
len = p \- buf;