diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-08-15 01:23:29 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-08-15 01:23:29 +0000 |
commit | 706074a5bb120f78f4fd8bc40c6814f14e17e530 (patch) | |
tree | c5da6add27af818bf38e5d9e4f9b3c2dedc718ff /manual/examples | |
parent | 046e3001f9370904c1efd764cfe49c472818ddfb (diff) | |
download | glibc-706074a5bb120f78f4fd8bc40c6814f14e17e530.tar glibc-706074a5bb120f78f4fd8bc40c6814f14e17e530.tar.gz glibc-706074a5bb120f78f4fd8bc40c6814f14e17e530.tar.bz2 glibc-706074a5bb120f78f4fd8bc40c6814f14e17e530.zip |
update from main archive 960814cvs/libc-960815
Diffstat (limited to 'manual/examples')
-rw-r--r-- | manual/examples/strdupa.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/manual/examples/strdupa.c b/manual/examples/strdupa.c new file mode 100644 index 0000000000..7d6ef39947 --- /dev/null +++ b/manual/examples/strdupa.c @@ -0,0 +1,19 @@ +#include <paths.h> +#include <string.h> +#include <stdio.h> + +const char path[] = _PATH_STDPATH; + +int +main (void) +{ + char *wr_path = strdupa (path); + char *cp = strtok (wr_path, ":"); + + while (cp != NULL) + { + puts (cp); + cp = strtok (NULL, ":"); + } + return 0; +} |