repo.or.cz
/
AROS.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Euro sign
[AROS.git]
/
compiler
/
purify
/
test6.c
blob
89b2111bc99b90288aa8556e960edee2c53138e3
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
int
main
(
int
argc
,
char
**
argv
)
5
{
6
char
*
str
;
7
int
i
;
8
9
str
=
malloc
(
8
);
10
11
printf
(
"str=%p (malloc)
\n
"
,
str
);
12
13
i
=
str
[
3
];
/* UMR */
14
15
str
[-
1
] =
0
;
/* IWR */
16
str
[
8
] =
0
;
/* IWR */
17
18
str
=
calloc
(
1
,
3
);
/* MLK */
19
20
printf
(
"str=%p (calloc)
\n
"
,
str
);
21
22
i
=
str
[
1
];
/* ok */
23
str
[
4
] =
0
;
/* IWR */
24
25
str
=
realloc
(
str
,
7
);
26
27
printf
(
"str=%p (realloc)
\n
"
,
str
);
28
29
str
[
4
] =
0
;
/* ok */
30
i
=
str
[
1
];
/* ok */
31
i
=
str
[
5
];
/* UMR */
32
33
free
(
str
);
34
35
i
=
str
[
1
];
/* FMR */
36
str
[
1
] =
1
;
/* FMW */
37
38
return
0
;
39
}