Code

libcollectclient: snprintf already NUL-terminates
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 2 Jul 2017 19:50:48 +0000 (21:50 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 2 Jul 2017 19:50:48 +0000 (21:50 +0200)
src/libcollectdclient/client.c

index c3cd414f202e9878d15a7768ea830c634e87b34f..51a4ab2388eb42fb127198bfec5849f88e3f4db9 100644 (file)
@@ -92,7 +92,6 @@
 #define LCC_SET_ERRSTR(c, ...)                                                 \
   do {                                                                         \
     snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__);                   \
-    (c)->errbuf[sizeof((c)->errbuf) - 1] = 0;                                  \
   } while (0)
 
 /*