Fix some minor checked-return bugs

Should resolve Coverity reports 158862, 158861, 158860.

158863 is spurious but I have no idea how to convince Coverity of that.
This commit is contained in:
Gregor Richards 2016-12-20 19:16:31 -05:00
parent b114aa9616
commit 7bb26eb5c5
2 changed files with 5 additions and 13 deletions

View File

@ -419,24 +419,14 @@ bool netplay_command(netplay_t* netplay, struct netplay_connection *connection,
enum netplay_cmd cmd, void* data, size_t sz, const char* command_str,
const char* success_msg)
{
char m[256];
const char* msg = NULL;
retro_assert(netplay);
if (!netplay_send_raw_cmd(netplay, connection, cmd, data, sz))
goto error;
return false;
runloop_msg_queue_push(success_msg, 1, 180, false);
return true;
error:
if (msg)
snprintf(m, sizeof(m), msg, command_str);
RARCH_WARN("%s\n", m);
runloop_msg_queue_push(m, 1, 180, false);
return false;
}
/**

View File

@ -384,7 +384,8 @@ bool netplay_handshake_init(netplay_t *netplay,
line.label = msg_hash_to_str(MSG_NETPLAY_ENTER_PASSWORD);
line.label_setting = "no_setting";
line.cb = handshake_password;
menu_input_dialog_start(&line);
if (!menu_input_dialog_start(&line))
return false;
}
/* Send our nick */
@ -892,7 +893,8 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
if (i == netplay->self_ptr)
{
/* Clear out any current data but still use this frame */
netplay_delta_frame_ready(netplay, ptr, 0);
if (!netplay_delta_frame_ready(netplay, ptr, 0))
return false;
ptr->frame = new_frame_count;
ptr->have_local = true;
netplay->other_ptr = netplay->unread_ptr = netplay->server_ptr = i;