aboutsummaryrefslogtreecommitdiffstats
path: root/man3/stpcpy.3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2009-02-03 10:25:32 +1300
committerMichael Kerrisk <mtk.manpages@gmail.com>2009-02-03 11:43:32 +1300
commit56e50303bb6a460023aba27350b2aad8da5405db (patch)
tree75d1f6cf410d7f90d5f5fa19c2401d8e2bb2c9c0 /man3/stpcpy.3
parentb6898014c5c273c93f9144b54434b359cfa46879 (diff)
downloadman-pages-56e50303bb6a460023aba27350b2aad8da5405db.tar.gz
stpcpy.3: Add missing pieces/fix various problems in example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3/stpcpy.3')
-rw-r--r--man3/stpcpy.34
1 files changed, 4 insertions, 0 deletions
diff --git a/man3/stpcpy.3 b/man3/stpcpy.3
index 40f28e6f9a..8a3071ab09 100644
--- a/man3/stpcpy.3
+++ b/man3/stpcpy.3
@@ -59,12 +59,16 @@ to concatenate \fBfoo\fP and
.in +4n
.nf
+#define _GNU_SOURCE
#include <string.h>
+#include <stdio.h>
int
main(void)
{
+ char buffer[20];
char *to = buffer;
+
to = stpcpy(to, "foo");
to = stpcpy(to, "bar");
printf("%s\\n", buffer);