diff options
author | Anselm R. Garbe <arg@10kloc.org> | 2006-10-12 12:59:37 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@10kloc.org> | 2006-10-12 12:59:37 +0200 |
commit | 95b19f75cce1ba994790ccf7ccdf1815d5d52d75 (patch) | |
tree | 74444eb5596f2b37692ab5f031b6ecc4bf598f2a | |
parent | 3d25a327aad95e38ecd1642af58a49fc555a9d01 (diff) |
changing order
-rw-r--r-- | util.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -18,15 +18,6 @@ emalloc(unsigned int size) { | |||
18 | return res; | 18 | return res; |
19 | } | 19 | } |
20 | 20 | ||
21 | char * | ||
22 | estrdup(const char *str) { | ||
23 | void *res = strdup(str); | ||
24 | |||
25 | if(!res) | ||
26 | eprint("fatal: could not malloc() %u bytes\n", strlen(str)); | ||
27 | return res; | ||
28 | } | ||
29 | |||
30 | void | 21 | void |
31 | eprint(const char *errstr, ...) { | 22 | eprint(const char *errstr, ...) { |
32 | va_list ap; | 23 | va_list ap; |
@@ -36,3 +27,12 @@ eprint(const char *errstr, ...) { | |||
36 | va_end(ap); | 27 | va_end(ap); |
37 | exit(EXIT_FAILURE); | 28 | exit(EXIT_FAILURE); |
38 | } | 29 | } |
30 | |||
31 | char * | ||
32 | estrdup(const char *str) { | ||
33 | void *res = strdup(str); | ||
34 | |||
35 | if(!res) | ||
36 | eprint("fatal: could not malloc() %u bytes\n", strlen(str)); | ||
37 | return res; | ||
38 | } | ||