summaryrefslogtreecommitdiff
path: root/code/ecp
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2019-10-13 05:21:28 +0200
committerUros Majstorovic <majstor@majstor.org>2019-10-13 05:21:28 +0200
commitca2d9002fcbebcf37f48944dd8d67e90c186ce4f (patch)
tree603660613302d30afca3687323c53f4434c36126 /code/ecp
parent8c6c68e92d6b4c8aa5e2fcc784ed52da40845acc (diff)
fixed msgq bug
Diffstat (limited to 'code/ecp')
-rw-r--r--code/ecp/msgq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/code/ecp/msgq.c b/code/ecp/msgq.c
index b928a2d..201af4a 100644
--- a/code/ecp/msgq.c
+++ b/code/ecp/msgq.c
@@ -76,7 +76,7 @@ int ecp_conn_msgq_push(ECPConnection *conn, ecp_seq_t seq, unsigned char mtype)
if (msgq == NULL) return ECP_ERR;
if (mtype >= ECP_MAX_MTYPE) return ECP_ERR_MAX_MTYPE;
- if (msgq->idx_w[mtype] - msgq->idx_r[mtype] == ECP_MSGQ_MAX_MSG) return ECP_MSGQ_ERR_MAX_MSG;
+ if ((unsigned short)(msgq->idx_w[mtype] - msgq->idx_r[mtype]) == ECP_MSGQ_MAX_MSG) return ECP_MSGQ_ERR_MAX_MSG;
if (msgq->idx_w[mtype] == msgq->idx_r[mtype]) pthread_cond_signal(&msgq->cond[mtype]);
msgq->seq_msg[mtype][MSG_IDX_MASK(msgq->idx_w[mtype])] = seq;