From: Florian Forster Date: Sat, 8 Nov 2008 17:04:21 +0000 (+0100) Subject: libcollectdclient: Document the used macros. X-Git-Tag: collectd-4.6.0~155^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4cff44c4a058540cf37ae058527d4415509aec72;p=collectd.git libcollectdclient: Document the used macros. They're probably not obvious unless you've doe quite some C coding. --- diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 2ec27742..baffe995 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -61,6 +61,10 @@ #include "client.h" +/* Secure/static macros. They work like `strcpy' and `strcat', but assure null + * termination. They work for static buffers only, because they use `sizeof'. + * The `SSTRCATF' combines the functionality of `snprintf' and `strcat' which + * is very useful to add formatted stuff to the end of a buffer. */ #define SSTRCPY(d,s) do { \ strncpy ((d), (s), sizeof (d)); \ (d)[sizeof (d) - 1] = 0; \