| | |
| | | strncpy(topics_buf + count, _input.topics[i], min); |
| | | count += min; |
| | | |
| | | if (total >= strlen(_input.topics[i])) { |
| | | total -= strlen(_input.topics[i]); |
| | | } |
| | | total -= min; |
| | | |
| | | if ((_input.amount > 1) && (i < (_input.amount - 1))) { |
| | | strncpy(topics_buf + count, STR_MAGIC, strlen(STR_MAGIC)); |
| | |
| | | } |
| | | } |
| | | |
| | | logger->debug("the parsed compound register topics: %s!\n", topics_buf); |
| | | //logger->debug("the parsed compound register topics: %s!\n", topics_buf); |
| | | #else |
| | | memcpy(topics_buf, topics, topics_len > (sizeof(topics_buf) - 1) ? (sizeof(topics_buf) - 1) : topics_len); |
| | | #endif |
| | |
| | | strncpy(topics_buf + count, _input.topics[i], min); |
| | | count += min; |
| | | |
| | | if (total >= strlen(_input.topics[i])) { |
| | | total -= strlen(_input.topics[i]); |
| | | } |
| | | total -= strlen(_input.topics[i]); |
| | | |
| | | if ((_input.amount > 1) && (i < (_input.amount - 1))) { |
| | | strncpy(topics_buf + count, STR_MAGIC, strlen(STR_MAGIC)); |
| | |
| | | topics_buf[strlen(topics_buf) - 1] = '\0'; |
| | | } |
| | | } |
| | | logger->debug("the parsed compound sub topics: %s!\n", topics_buf); |
| | | //logger->debug("the parsed compound sub topics: %s!\n", topics_buf); |
| | | #else |
| | | memcpy(topics_buf, topics, topics_len > (sizeof(topics_buf) - 1) ? (sizeof(topics_buf) - 1) : topics_len); |
| | | #endif |