From f305e235f9f13a0b740eedccc87eff32487a8926 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 30 Apr 2019 19:50:22 -0700 Subject: [PATCH] Fix bugs found by compiler warnings --- src/loop.c | 5 +++-- src/main.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/loop.c b/src/loop.c index 7e169e4e..d49b4d71 100644 --- a/src/loop.c +++ b/src/loop.c @@ -76,14 +76,15 @@ void loop_remove_fd(int fd) { int fdindex; for (int i=0;i 0) { memcpy(&fds[fdindex], &fds[numFds], sizeof(struct pollfd)); - memcpy(&fdHandlers[fdindex], &fdHandlers[numFds], sizeof(FdHandler*)); + memcpy(&fdHandlers[fdindex], &fdHandlers[numFds], sizeof(FdHandler)); } } diff --git a/src/main.c b/src/main.c index 037090cd..04b0c1d6 100644 --- a/src/main.c +++ b/src/main.c @@ -95,7 +95,7 @@ static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform sys #ifdef HAVE_SDL gamepads += sdl_gamepads; #endif - int gamepad_mask; + int gamepad_mask = 0; for (int i = 0; i < gamepads && i < 4; i++) gamepad_mask = (gamepad_mask << 1) + 1;