X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.c;h=8502208de1fd74c698bdf37d2c56e9e27b286f8d;hb=80294418289129eb75c9f07e2043adcbd02941a4;hp=ec5c7ababee0473c006cd90206afe6d1d2b42188;hpb=fbaf81a04c23d51947d94a5c7d9142290dff07bc;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