浏览代码

casting bugfix

Julius Pfrommer 10 年之前
父节点
当前提交
65ce9a6e2b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      examples/networklayer_tcp.c

+ 2 - 2
examples/networklayer_tcp.c

@@ -46,11 +46,11 @@ static UA_StatusCode socket_write(UA_Connection *connection, const UA_ByteString
         UA_Int32 n = 0;
         do {
 #ifdef _WIN32
-            n = send((SOCKET)connection->sockfd, buf->data, buf->length, 0);
+            n = send((SOCKET)connection->sockfd, (const char*)buf->data, buf->length, 0);
             if(n != 0 &&WSAGetLastError() != WSAEINTR)
                 return UA_STATUSCODE_BADCONNECTIONCLOSED;
 #else
-            n = send(connection->sockfd, buf->data, buf->length, MSG_NOSIGNAL);
+            n = send(connection->sockfd, (const char*)buf->data, buf->length, MSG_NOSIGNAL);
             if(n == -1L && errno != EINTR)
                 return UA_STATUSCODE_BADCONNECTIONCLOSED;
 #endif