diff --git a/src/ckpmsg.c b/src/ckpmsg.c index 0227dca1..9129a43c 100644 --- a/src/ckpmsg.c +++ b/src/ckpmsg.c @@ -72,7 +72,7 @@ int main(int argc, char **argv) break; } if (!send_unix_msg(sockd, buf)) { - LOGERR("Failed to end unix msg: %s", buf); + LOGERR("Failed to send unix msg: %s", buf); break; } dealloc(buf); diff --git a/src/libckpool.c b/src/libckpool.c index 934f4be5..b445bc47 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -918,7 +918,7 @@ static const int hex2bin_tbl[256] = { }; /* Does the reverse of bin2hex but does not allocate any ram */ -bool hex2bin(void *vp, const void *vhexstr, size_t len) +bool _hex2bin(void *vp, const void *vhexstr, size_t len, const char *file, const char *func, const int line) { const uchar *hexstr = vhexstr; int nibble1, nibble2; @@ -928,7 +928,7 @@ bool hex2bin(void *vp, const void *vhexstr, size_t len) while (*hexstr && len) { if (unlikely(!hexstr[1])) { - LOGWARNING("Early end of string in hex2bin"); + LOGWARNING("Early end of string in hex2bin from %s %s:%d", file, func, line); return ret; } @@ -938,7 +938,7 @@ bool hex2bin(void *vp, const void *vhexstr, size_t len) nibble2 = hex2bin_tbl[idx]; if (unlikely((nibble1 < 0) || (nibble2 < 0))) { - LOGWARNING("Invalid binary encoding in hex2bin"); + LOGWARNING("Invalid binary encoding in hex2bin from %s %s:%d", file, func, line); return ret; } @@ -949,7 +949,7 @@ bool hex2bin(void *vp, const void *vhexstr, size_t len) if (likely(len == 0 && *hexstr == 0)) ret = true; if (!ret) - LOGWARNING("Failed hex2bin decode"); + LOGWARNING("Failed hex2bin decode from %s %s:%d", file, func, line); return ret; } diff --git a/src/libckpool.h b/src/libckpool.h index 9f3438aa..a3c14564 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -366,7 +366,8 @@ void *_ckzalloc(size_t len, const char *file, const char *func, const int line); void _dealloc(void **ptr); void __bin2hex(void *vs, const void *vp, size_t len); void *bin2hex(const void *vp, size_t len); -bool hex2bin(void *p, const void *vhexstr, size_t len); +bool _hex2bin(void *p, const void *vhexstr, size_t len, const char *file, const char *func, const int line); +#define hex2bin(p, vhexstr, len) _hex2bin(p, vhexstr, len, __FILE__, __func__, __LINE__) char *http_base64(const char *src); void b58tobin(char *b58bin, const char *b58);