X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.c;h=8502208de1fd74c698bdf37d2c56e9e27b286f8d;hb=90e7e99e0da5efb00991ef3c6efa0fdc2cb56701;hp=ec5c7ababee0473c006cd90206afe6d1d2b42188;hpb=42b8d7550d029ed9aef6f25e3eb2009c1f18b144;p=collectd.git diff --git a/src/daemon/common.c b/src/daemon/common.c index ec5c7aba..8502208d 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -352,6 +352,9 @@ int strjoin(char *buffer, size_t buffer_size, char **fields, size_t fields_num, buffer_req += sep_len; buffer_req += field_len; + if (buffer_size == 0) + continue; + if ((i != 0) && (sep_len > 0)) { if (sep_len >= avail) { /* prevent subsequent iterations from writing to the