From 291fc0e6df99b0fc654f6b15c9f86fb2ea7165cd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 2 Jun 2012 01:23:43 +0100 Subject: [PATCH] revert misguided bytes2hex move --- authbind.h | 10 ---------- helper.c | 4 +++- libauthbind.c | 4 +++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/authbind.h b/authbind.h index 94abaa0..3911c08 100644 --- a/authbind.h +++ b/authbind.h @@ -30,18 +30,8 @@ # define HELPER "/usr/local/lib/authbind/helper" #endif -#ifndef CONFIGDIR -# define CONFIGDIR "/etc/authbind" -#endif - #define PRELOAD_VAR "LD_PRELOAD" #define AUTHBINDLIB_VAR "AUTHBIND_LIB" #define AUTHBIND_LEVELS_VAR "AUTHBIND_LEVELS" -static inline void bytes2hex(const unsigned char *in, char *out, size_t len) { - size_t i; - for (i=0; i<16; i++) - sprintf(out+i*2,"%02x", in[i]); -} - #endif diff --git a/helper.c b/helper.c index 9e8ab86..f58ee9e 100644 --- a/helper.c +++ b/helper.c @@ -30,7 +30,9 @@ #include #include -#include "authbind.h" +#ifndef CONFIGDIR +# define CONFIGDIR "/etc/authbind" +#endif static void exiterrno(int e) { exit(e>0 && e<128 ? e : ENOSYS); diff --git a/libauthbind.c b/libauthbind.c index 03905e4..a685ce3 100644 --- a/libauthbind.c +++ b/libauthbind.c @@ -185,7 +185,9 @@ int bind(int fd, const struct sockaddr *addr, socklen_t addrlen) { break; case AF_INET6: afarg = "6"; - bytes2hex(((struct sockaddr_in6*)addr)->sin6_addr.s6_addr, addrarg, 16); + for (i=0; i<16; i++) + sprintf(addrarg+i*2,"%02x", + ((struct sockaddr_in6*)addr)->sin6_addr.s6_addr[i]); break; default: abort(); -- 2.30.2