Module: check_mk
Branch: master
Commit: ab13e3f0ef63052e0630bb9c1ef45d7d31b70f07
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab13e3f0ef6305…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 5 10:36:15 2012 +0100
check_icmp: fixed length calculation of output buffer
---
ChangeLog | 1 +
livestatus/src/check_icmp.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6bb45d3..c961f62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,7 @@
Livestatus
* FIX: comments_with_info in service table was always empty
+ * FIX: check_icmp: fixed calculation of remaining length of output buffer
Livecheck
* FIX: fixed problem with long plugin output
diff --git a/livestatus/src/check_icmp.c b/livestatus/src/check_icmp.c
index d5eba33..fb015e7 100644
--- a/livestatus/src/check_icmp.c
+++ b/livestatus/src/check_icmp.c
@@ -242,7 +242,7 @@ void do_output(int crash, char *format, ...)
{
va_list ap;
va_start(ap, format);
- int place_left = g_output_pointer - g_output_buffer + g_output_buffer_size;
+ int place_left = g_output_buffer + g_output_buffer_size - g_output_pointer;
g_output_pointer += vsnprintf(g_output_pointer, place_left, format, ap);
va_end(ap);
*g_output_pointer = 0;