diff options
author | Natanael Copa <natanael.copa@gmail.com> | 2008-12-18 21:22:55 +0100 |
---|---|---|
committer | Natanael Copa <natanael.copa@gmail.com> | 2008-12-18 21:22:55 +0100 |
commit | 8377d611fc80fc0d9e498d958c40fce59f3f29e1 (patch) | |
tree | 201010526cf2d6d8036cb9f6334043a9e8d51171 /pingu.c | |
parent | 518df3c6280fa4829d6e389da6ade6a025c2e6c0 (diff) | |
download | pingu-8377d611fc80fc0d9e498d958c40fce59f3f29e1.tar.bz2 pingu-8377d611fc80fc0d9e498d958c40fce59f3f29e1.tar.xz |
xlib.c: moved utility funcs to separate file
Diffstat (limited to 'pingu.c')
-rw-r--r-- | pingu.c | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -7,6 +7,7 @@ #include <unistd.h> #include "pingu.h" +#include "xlib.h" int pingu_verbose = 0; @@ -19,30 +20,6 @@ struct provider { int status; }; -void *xmalloc(size_t size) -{ - void *p = malloc(size); - if (p == NULL) - err(EXIT_FAILURE, "malloc"); - return p; -} - -void *xrealloc(void *ptr, size_t size) -{ - void *p = realloc(ptr, size); - if (p == NULL) - err(EXIT_FAILURE, "realloc"); - return p; -} - -char *xstrdup(const char *str) -{ - char *s = strdup(str); - if (s == NULL) - err(EXIT_FAILURE, "strdup"); - return s; -} - #if 0 int skip(char **str, int whitespace) { |