]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
stpncpy.3: EXAMPLES: tfix
authorAlejandro Colomar <alx@kernel.org>
Wed, 25 Jan 2023 23:08:22 +0000 (00:08 +0100)
committerAlejandro Colomar <alx@kernel.org>
Thu, 26 Jan 2023 00:01:55 +0000 (01:01 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man3/stpncpy.3

index c9775f65381141c28ebf7a31fa76a8089a8015ce..9d752efe20274d8c5e5896025876ca107ed9c322 100644 (file)
@@ -144,7 +144,7 @@ main(void)
 
     if (sizeof(buf2) < strlen("Hello world!"))
         warnx("strncpy: truncating character sequence");
-    strncpy(buf2, "Hello world!", sizeof(buf));
+    strncpy(buf2, "Hello world!", sizeof(buf2));
     len = strnlen(buf2, sizeof(buf2));
 
     printf("[len = %zu]: ", len);