Updated Sourceforge username and host.
[tangerine.git] / compiler / purify / test10.c
blobef62b1083d928ef3d754b3275c4ea203bfca69d0
1 #include <stdio.h>
2 #include <string.h>
3 #include <stdlib.h>
5 int main (int argc, char ** argv)
7 int len;
8 char *str;
10 len = strlen (argv[0])-2;
11 if (len < 0)
12 len = 1;
13 str = malloc (len + 1); /* MLK */
15 strncpy (str, argv[0], len);
16 str[len] = 0;
18 printf ("str=%s\n", str);
20 str = strdup (argv[0]); /* MLK */
22 printf ("str=%s\n", str);
24 str = strdup ("hallo"); /* MLK */
26 printf ("str=%s\n", str);
28 str = strdup (str); /* MLK */
30 printf ("str=%s\n", str);
32 return 0;