summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-09-01 22:33:39 +0200
committerHein-Pieter van Braam <hp@tmm.cx>2017-09-02 01:59:26 +0200
commit9c63ab99f0a505b0f60079bb30cc453b4415fddc (patch)
tree7014cb6e8c2e71a0583656f76d3d37d719a74fb0 /drivers/unix
parentdac150108ab3c1f41d5fd86cc6853f883064caaf (diff)
Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/packet_peer_udp_posix.cpp4
-rw-r--r--drivers/unix/tcp_server_posix.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp
index b743990b92..61d2737555 100644
--- a/drivers/unix/packet_peer_udp_posix.cpp
+++ b/drivers/unix/packet_peer_udp_posix.cpp
@@ -73,8 +73,8 @@ Error PacketPeerUDPPosix::get_packet(const uint8_t **r_buffer, int &r_buffer_siz
if (queue_count == 0)
return ERR_UNAVAILABLE;
- uint32_t size;
- uint8_t type;
+ uint32_t size = 0;
+ uint8_t type = IP::TYPE_NONE;
rb.read(&type, 1, true);
if (type == IP::TYPE_IPV4) {
uint8_t ip[4];
diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp
index f3f9ab82f1..5062a74b63 100644
--- a/drivers/unix/tcp_server_posix.cpp
+++ b/drivers/unix/tcp_server_posix.cpp
@@ -165,7 +165,7 @@ Ref<StreamPeerTCP> TCPServerPosix::take_connection() {
Ref<StreamPeerTCPPosix> conn = memnew(StreamPeerTCPPosix);
IP_Address ip;
- int port;
+ int port = 0;
_set_ip_addr_port(ip, port, &their_addr);
conn->set_socket(fd, ip, port, sock_type);