--- a/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Sat Oct 24 03:56:02 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Sat Oct 24 15:27:47 2015 +0200
@@ -69,14 +69,14 @@
#pragma mark Communication layer
-(int) sendToServer:(NSString *)command {
NSString *message = [[NSString alloc] initWithFormat:@"%@\n\n",command];
- int result = SDLNet_TCP_Send(self.ssd, [message UTF8String], [message length]);
+ int result = SDLNet_TCP_Send(self.ssd, [message UTF8String], [message lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
[message release];
return result;
}
-(int) sendToServer:(NSString *)command withArgument:(NSString *)argument {
NSString *message = [[NSString alloc] initWithFormat:@"%@\n%@\n\n",command,argument];
- int result = SDLNet_TCP_Send(self.ssd, [message UTF8String], [message length]);
+ int result = SDLNet_TCP_Send(self.ssd, [message UTF8String], [message lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
[message release];
return result;
}