aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-22 13:36:37 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-22 13:36:37 +0200
commit7d0ad0f5211087124d0897869275f51f83780cc5 (patch)
tree3c1797428a52ff2436ea7b8ffdee6e5c40587a62 /src
parent9bd75d5668e89dc41857e01d62becce79a9f9ac8 (diff)
downloadminetest-7d0ad0f5211087124d0897869275f51f83780cc5.tar.gz
minetest-7d0ad0f5211087124d0897869275f51f83780cc5.tar.bz2
minetest-7d0ad0f5211087124d0897869275f51f83780cc5.zip
Fix UDPSocket's debug output
Diffstat (limited to 'src')
-rw-r--r--src/socket.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 7b70d4295..af32210c4 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -227,7 +227,8 @@ void UDPSocket::Send(const Address & destination, const void * data, int size)
dstream<<", size="<<size<<", data=";
for(int i=0; i<size && i<20; i++){
if(i%2==0) DEBUGPRINT(" ");
- DEBUGPRINT("%.2X", ((int)((const char*)data)[i])&0xff);
+ unsigned int a = ((const unsigned char*)data)[i];
+ DEBUGPRINT("%.2X", a);
}
if(size>20)
dstream<<"...";
@@ -289,7 +290,8 @@ int UDPSocket::Receive(Address & sender, void * data, int size)
dstream<<", size="<<received<<", data=";
for(int i=0; i<received && i<20; i++){
if(i%2==0) DEBUGPRINT(" ");
- DEBUGPRINT("%.2X", ((int)((const char*)data)[i])&0xff);
+ unsigned int a = ((const unsigned char*)data)[i];
+ DEBUGPRINT("%.2X", a);
}
if(received>20)
dstream<<"...";