From a66aa1c50d1c8680725512043a9db113b7e73284 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 9 May 2016 06:42:59 +0200 Subject: [PATCH] Cleanups --- cores/retropad/retropad.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cores/retropad/retropad.c b/cores/retropad/retropad.c index e2fd0f7c4a..608866b57d 100644 --- a/cores/retropad/retropad.c +++ b/cores/retropad/retropad.c @@ -46,15 +46,16 @@ #define SOCKET_ERROR -1 #endif +int s; +int port; +char message[64]; +char server[64]; +struct sockaddr_in si_other; struct retro_log_callback logger; retro_log_printf_t log_cb; static uint16_t *frame_buf; -struct sockaddr_in si_other; -int s, slen=sizeof(si_other); -char message[64]; -char server[64]; -int port; + int input_state = 0; void retro_init(void) @@ -224,7 +225,7 @@ void retro_run(void) snprintf(message, sizeof(message), "%d", input_state); /* send the message */ - if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, slen)==-1) + if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, sizeof(si_other))==-1) log_cb(RETRO_LOG_INFO, "Error sending data\n"); for (i = 0; i < 320 * 240; i++)