From efbcf88fb873cee8d70a4e4986de79aab87793a1 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 12 Apr 2016 05:37:27 +0000 Subject: [PATCH] Fixed output when more than two elements have to put FossilOrigin-Name: 398fd7b33f79756c1a9d4c1dd13107830e6d15ecf42b61ff6f462781b9f4964a --- src/cw/cw_out_radio_generic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cw/cw_out_radio_generic.c b/src/cw/cw_out_radio_generic.c index 58313c87..5b3aff7b 100644 --- a/src/cw/cw_out_radio_generic.c +++ b/src/cw/cw_out_radio_generic.c @@ -19,6 +19,8 @@ int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * d vendor specific payload */ int start = a->vendor_id ? 10 : 4; + uint8_t * d = dst+l; + struct mbag_item * item = mbag_get(radio->data,a->item_id); @@ -26,13 +28,13 @@ int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * d continue; } int len=0; - len += cw_put_byte(dst+start,radio->iid); - len += cw_put_mbag_item(dst + start+1, item); + len += cw_put_byte(d+start,radio->iid); + len += cw_put_mbag_item(d + start+1, item); if (a->vendor_id) - l+= len + cw_put_elem_vendor_hdr(dst, a->vendor_id, a->elem_id, len); + l+= len + cw_put_elem_vendor_hdr(d, a->vendor_id, a->elem_id, len); else - l += len + cw_put_elem_hdr(dst, a->elem_id, len); + l += len + cw_put_elem_hdr(d, a->elem_id, len);