Correct error handling when no message is defined.

FossilOrigin-Name: 964d457584bbfbb9399a162faafd12b29a1e2f18f09ee4d3ec98aaaba6af9f19
This commit is contained in:
7u83@mail.ru 2016-03-05 08:03:52 +00:00
parent 986248cc67
commit 3297370f34
1 changed files with 4 additions and 2 deletions

View File

@ -76,8 +76,10 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
int cw_send_request(struct conn *conn,int msg_id)
{
cw_init_request(conn, msg_id);
if ( cw_put_msg(conn, conn->req_buffer) == -1 )
return 0;
if ( cw_put_msg(conn, conn->req_buffer) == -1 ){
errno=ENOMSG;
return -1;
}
conn_send_msg(conn, conn->req_buffer);