[collectd] [PATCH] src/plugin.c: Increase the plugin_log() message buffer to 1024 bytes.

Sebastian Harl sh at tokkee.org
Tue Sep 16 15:38:48 CEST 2008


512 bytes is not enough for some perl error messages.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 src/plugin.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/plugin.c b/src/plugin.c
index 2b5a34d..1ec2544 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -830,7 +830,7 @@ int plugin_dispatch_notification (const notification_t *notif)
 
 void plugin_log (int level, const char *format, ...)
 {
-	char msg[512];
+	char msg[1024];
 	va_list ap;
 
 	void (*callback) (int, const char *);
@@ -845,8 +845,8 @@ void plugin_log (int level, const char *format, ...)
 #endif
 
 	va_start (ap, format);
-	vsnprintf (msg, 512, format, ap);
-	msg[511] = '\0';
+	vsnprintf (msg, sizeof (msg), format, ap);
+	msg[sizeof (msg) - 1] = '\0';
 	va_end (ap);
 
 	le = llist_head (list_log);
-- 
1.6.0.1.216.g1b23a

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080916/8c5ca92b/attachment.pgp 


More information about the collectd mailing list