attempt to fix include copy
[AROS.git] / compiler / purify / test10.c
blob784b78152f25ce0fc69c99dcecde5587e55bb309
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdio.h>
7 #include <string.h>
8 #include <stdlib.h>
10 int main (int argc, char ** argv)
12 int len;
13 char *str;
15 len = strlen (argv[0])-2;
16 if (len < 0)
17 len = 1;
18 str = malloc (len + 1); /* MLK */
20 strncpy (str, argv[0], len);
21 str[len] = 0;
23 printf ("str=%s\n", str);
25 str = strdup (argv[0]); /* MLK */
27 printf ("str=%s\n", str);
29 str = strdup ("hallo"); /* MLK */
31 printf ("str=%s\n", str);
33 str = strdup (str); /* MLK */
35 printf ("str=%s\n", str);
37 return 0;