core: use string instead of compound literal
[rofl0r-proxychains-ng.git] / src / debug.c
blob314aadd80a8bb92b359a4a1c426773ef7d6760a5
2 #ifdef DEBUG
3 # include "core.h"
4 # include "common.h"
5 # include "debug.h"
6 #include <arpa/inet.h>
8 void dump_proxy_chain(proxy_data *pchain, unsigned int count) {
9 char ip_buf[INET6_ADDRSTRLEN];
10 for (; count; pchain++, count--) {
11 if(!inet_ntop(pchain->ip.is_v6?AF_INET6:AF_INET,pchain->ip.addr.v6,ip_buf,sizeof ip_buf)) {
12 proxychains_write_log(LOG_PREFIX "error: ip address conversion failed\n");
13 continue;
15 PDEBUG("[%s] %s %s:%d", proxy_state_strmap[pchain->ps],
16 proxy_type_strmap[pchain->pt],
17 ip_buf, htons(pchain->port));
18 if (*pchain->user || *pchain->pass) {
19 PSTDERR(" [u=%s,p=%s]", pchain->user, pchain->pass);
21 PSTDERR("\n");
25 #else
27 // Do not allow this translation unit to end up empty
28 // for non-DEBUG builds, to satisfy ISO C standards.
29 typedef int __appease_iso_compilers__;
31 #endif