diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-13 21:25:09 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-13 21:25:09 +0000 |
commit | 4f0a5e7572a4257894b4bfede42c26d65152609e (patch) | |
tree | 21e3d5ee20716739590e5931859a4c2052161395 /avahi-core/util.c | |
parent | d6d7d3769441b73ffb5b7af34fef823b41e66312 (diff) |
* strip glib from avahi-core
* implement glib memory allocator
* add new documentation file MALLOC
* initialize pseudo-RNG from /dev/urandom in avahi-daemon
* remove some gcc 4.0 warnings
* beef up watch system with real timeouts
* move GCC __attribute__ macros into its own header avahi-common/gccmacro.h
* make use of GCC's sentinel attribute where it make sense
* add malloc() implementations that abort on OOM and enable them by default
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@308 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/util.c')
-rw-r--r-- | avahi-core/util.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/avahi-core/util.c b/avahi-core/util.c index 4fe8737..77632fd 100644 --- a/avahi-core/util.c +++ b/avahi-core/util.c @@ -29,8 +29,7 @@ #include <assert.h> #include <ctype.h> -#include <glib.h> - +#include <avahi-common/malloc.h> #include "util.h" void avahi_hexdump(const void* p, size_t size) { @@ -73,7 +72,8 @@ char *avahi_format_mac_address(const uint8_t* mac, size_t size) { unsigned i; static const char hex[] = "0123456789abcdef"; - t = r = g_new(char, size > 0 ? size*3 : 1); + if (!(t = r = avahi_new(char, size > 0 ? size*3 : 1))) + return NULL; if (size <= 0) { *r = 0; @@ -92,8 +92,6 @@ char *avahi_format_mac_address(const uint8_t* mac, size_t size) { return r; } - - char *avahi_strdown(char *s) { char *c; @@ -114,4 +112,3 @@ char *avahi_strup(char *s) { return s; } - |