project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m
branchios-revival
changeset 11240 57891137ffef
parent 11137 14f50dde3e8c
child 12872 00215a7ec5f5
--- 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;
 }