author | Florian Forster <octo@collectd.org> | |
Thu, 15 Sep 2016 06:59:16 +0000 (08:59 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 15 Sep 2016 07:03:00 +0000 (09:03 +0200) | ||
commit | afb38f31abd27d5b4ce08023f8bbbaeeb353c55f | |
tree | db1e676d29883bed3aa714ea1cea4b188dbc4e8c | tree | snapshot |
parent | f7d1db6cc1bed058ca03747f5c6bdd07ce12be27 | commit | diff |
src/daemon/common.[ch]: Reimplement strjoin().
This new implementation truncates fields rather than aborting when there
is more space in the output buffer. Since strjoin() is mostly used to
fill plugin and type instances, which are otherwise usually filled with
sstrncpy(), i.e. also truncate the string rather than erroring out.
The unit test has also been rewritten to test the new functionality.
The new functions have been formatted with clang-format.
Fixes: #1792
This new implementation truncates fields rather than aborting when there
is more space in the output buffer. Since strjoin() is mostly used to
fill plugin and type instances, which are otherwise usually filled with
sstrncpy(), i.e. also truncate the string rather than erroring out.
The unit test has also been rewritten to test the new functionality.
The new functions have been formatted with clang-format.
Fixes: #1792
src/daemon/common.c | diff | blob | history | |
src/daemon/common.h | diff | blob | history | |
src/daemon/common_test.c | diff | blob | history |