From 5d181d9ef84be3db802236c071fb15d2bc354664 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 17 Dec 2023 13:41:22 +0100 Subject: 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 --- man7/string_copying.7 | 4 ++-- 1 file 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; -- cgit v1.2.3