From b55923a8d33a1c4ed2f892a0da36c9c679e7d828 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 7 Nov 2004 20:48:46 +0000 Subject: * Look for M4 in configure.ac * Share auth cookies in module-tunnel.c, module-x11-publish.c and native-protocol.c * disable TCP_NODELAY * publish auth cookie in module-x11-publish git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@274 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/util.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'polyp/util.c') diff --git a/polyp/util.c b/polyp/util.c index 6e97bae4..97b3a26b 100644 --- a/polyp/util.c +++ b/polyp/util.c @@ -715,3 +715,20 @@ FILE *pa_open_config_file(const char *global, const char *local, const char *env return fopen(global, "r"); } +/* Format the specified data as a hexademical string */ +char *pa_hexstr(const uint8_t* d, size_t dlength, char *s, size_t slength) { + size_t i = 0, j = 0; + const char hex[] = "0123456789abcdef"; + assert(d && s && slength > 0); + + while (i < dlength && j+3 <= slength) { + s[j++] = hex[*d >> 4]; + s[j++] = hex[*d & 0xF]; + + d++; + i++; + } + + s[j < slength ? j : slength] = 0; + return s; +} -- cgit