From 4cff44c4a058540cf37ae058527d4415509aec72 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 8 Nov 2008 18:04:21 +0100 Subject: [PATCH] libcollectdclient: Document the used macros. They're probably not obvious unless you've doe quite some C coding. --- src/libcollectdclient/client.c | 4 ++++ 1 file changed, 4 insertions(+) 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; \ -- 2.11.0