fujuntang
2021-08-31 511496a608be4ce2c0189ab0021d05ef2434da89
Fix the topics parse issue when very long topics are given.
1个文件已修改
8 ■■■■ 已修改文件
src/bh_api.cpp 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/bh_api.cpp
@@ -343,7 +343,7 @@
        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++;
@@ -775,9 +775,9 @@
        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++;
@@ -914,7 +914,7 @@
  int node_arr_len = 0;
#if defined(PRO_DE_SERIALIZE)
  struct _MsgPublish
  struct MsgPublish
    {
        const char *topic;
        const char *data;