summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-12-04 23:04:24 +0000
committererdgeist <>2007-12-04 23:04:24 +0000
commit0bfab763d8401983edf40fe8421e3f68ef337dad (patch)
tree9396a7280423b279d51314598593e6ddbeb73633
parent362a0e052a9c586bffcd91348f924fe287ab8249 (diff)
print ip addresses from unsigned chars
-rw-r--r--ot_stats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ot_stats.c b/ot_stats.c
index 717e943..e682599 100644
--- a/ot_stats.c
+++ b/ot_stats.c
@@ -306,14 +306,14 @@ void stats_issue_event( ot_status_event event, int is_tcp, size_t event_data ) {
306 break; 306 break;
307 case EVENT_FULLSCRAPE_REQUEST: 307 case EVENT_FULLSCRAPE_REQUEST:
308 { 308 {
309 char ip[4]; *(int*)ip = is_tcp; /* ugly hack to transfer ip to stats */ 309 unsigned char ip[4]; *(int*)ip = is_tcp; /* ugly hack to transfer ip to stats */
310 LOG_TO_STDERR( "[%08d] scrp: %d.%d.%d.%d - FULL SCRAPE\n", (unsigned int)(g_now - ot_start_time), ip[0], ip[1], ip[2], ip[3] ); 310 LOG_TO_STDERR( "[%08d] scrp: %d.%d.%d.%d - FULL SCRAPE\n", (unsigned int)(g_now - ot_start_time), ip[0], ip[1], ip[2], ip[3] );
311 ot_full_scrape_request_count++; 311 ot_full_scrape_request_count++;
312 } 312 }
313 break; 313 break;
314 case EVENT_FULLSCRAPE_REQUEST_GZIP: 314 case EVENT_FULLSCRAPE_REQUEST_GZIP:
315 { 315 {
316 char ip[4]; *(int*)ip = is_tcp; /* ugly hack to transfer ip to stats */ 316 unsigned char ip[4]; *(int*)ip = is_tcp; /* ugly hack to transfer ip to stats */
317 LOG_TO_STDERR( "[%08d] scrp: %d.%d.%d.%d - FULL SCRAPE GZIP\n", (unsigned int)(g_now - ot_start_time), ip[0], ip[1], ip[2], ip[3] ); 317 LOG_TO_STDERR( "[%08d] scrp: %d.%d.%d.%d - FULL SCRAPE GZIP\n", (unsigned int)(g_now - ot_start_time), ip[0], ip[1], ip[2], ip[3] );
318 ot_full_scrape_request_count++; 318 ot_full_scrape_request_count++;
319 } 319 }