Fix the topics parse issue when very long topics are given.
| | |
| | | |
| | | total -= min; |
| | | |
| | | if ((_input.amount > 1) && (i < (_input.amount - 1))) { |
| | | if ((total > 1) && (_input.amount > 1) && (i < (_input.amount - 1))) { |
| | | strncpy(topics_buf + count, STR_MAGIC, strlen(STR_MAGIC)); |
| | | total -= 1; |
| | | count++; |
| | |
| | | strncpy(topics_buf + count, _input.topics[i], min); |
| | | count += min; |
| | | |
| | | total -= strlen(_input.topics[i]); |
| | | total -= min; |
| | | |
| | | if ((_input.amount > 1) && (i < (_input.amount - 1))) { |
| | | if ((total > 1) && (_input.amount > 1) && (i < (_input.amount - 1))) { |
| | | strncpy(topics_buf + count, STR_MAGIC, strlen(STR_MAGIC)); |
| | | total -= 1; |
| | | count++; |
| | |
| | | int node_arr_len = 0; |
| | | |
| | | #if defined(PRO_DE_SERIALIZE) |
| | | struct _MsgPublish |
| | | struct MsgPublish |
| | | { |
| | | const char *topic; |
| | | const char *data; |