-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappendixD.tr
More file actions
48 lines (48 loc) · 784 Bytes
/
appendixD.tr
File metadata and controls
48 lines (48 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.ce 2
Приложение D
.sp 1
.
\fBФайл xstdlib.c\fP
.sp 1
.
.ps 10p
.vs 11p
.
.fam C
1 #include "xstdlib.h"
2
3 void *xmalloc(size_t size)
4 {
5 void *vp;
6
7 errno = 0;
8 vp = malloc(size);
9
10 if (size != 0 && vp == NULL) {
11 perror("markov");
12
13 exit(EXIT_FAILURE);
14 }
15
16 return vp;
17 }
18
19 void *xrealloc(void *p, size_t size)
20 {
21 void *vp;
22
23 errno = 0;
24 vp = realloc(p, size);
25
26 if (size != 0 && vp == NULL) {
27 perror("markov");
28
29 exit(EXIT_FAILURE);
30 }
31
32 return vp;
33 }
.sp 1
.fam T
.ps 13
.vs 16