Skip to content

Commit

Permalink
adapt to cloud gateway mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhibo committed Oct 25, 2018
1 parent 77414bc commit 8545854
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helper/emhost/emh_qlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ void emh_qlink_event_handler(void)
int32_t count;
require_action(ATCmdParser_recv("%d,", &count), exit, err = kMalformedErr);

uint8_t *data = malloc(count);
uint8_t *data = malloc(count+1);
require_action(data, exit, err = kNoMemoryErr);
require_action(ATCmdParser_read((char *)data, count) == count, exit, err = kTimeoutErr);

*(data+count) = 0x00;
msg.data = data;
msg.format = EMH_ARG_QLINK_FORMAT_JSON;
msg.len = count;
Expand Down

0 comments on commit 8545854

Please sign in to comment.