Parent Directory | Revision Log
Just indent(1) to K&R style or small changes.
1 | lefcha | 1.1 | #include <stdlib.h> |
2 | #include <string.h> | ||
3 | #include <errno.h> | ||
4 | |||
5 | #include "imapfilter.h" | ||
6 | |||
7 | /* | ||
8 | * A malloc that checks the results and dies in case of error. | ||
9 | */ | ||
10 | void *xmalloc(size_t size) | ||
11 | { | ||
12 | void *ptr; | ||
13 | lefcha | 1.2 | |
14 | lefcha | 1.1 | ptr = (void *) malloc(size); |
15 | lefcha | 1.2 | |
16 | lefcha | 1.1 | if (!ptr) |
17 | fatal(ERROR_MEMORY_ALLOCATION, | ||
18 | "imapfilter: allocating memory; %s\n", strerror(errno)); | ||
19 | lefcha | 1.2 | |
20 | lefcha | 1.1 | return ptr; |
21 | } | ||
22 | |||
23 | |||
24 | /* | ||
25 | * A strdup that checks the results and dies in case of error. | ||
26 | */ | ||
27 | char *xstrdup(const char *s) | ||
28 | { | ||
29 | char *cp; | ||
30 | lefcha | 1.2 | |
31 | lefcha | 1.1 | cp = strdup(s); |
32 | lefcha | 1.2 | |
33 | lefcha | 1.1 | if (!cp) |
34 | fatal(ERROR_MEMORY_ALLOCATION, | ||
35 | "imapfilter: allocating memory; %s\n", strerror(errno)); | ||
36 | lefcha | 1.2 | |
37 | lefcha | 1.1 | return cp; |
38 | lefcha | 1.2 | } |
webmaster@linux.gr | ViewVC Help |
Powered by ViewVC 1.1.26 |