From 3a8797cd29e8d77c85c33bd223e99b104cba8b47 Mon Sep 17 00:00:00 2001
From: Ramon Novoa <rnovoa@artica.es>
Date: Thu, 28 May 2009 14:05:17 +0000
Subject: [PATCH] 2009-05-28  Ramon Novoa  <rnovoa@artica.es>

	* modules/pandora_module_logevent.cc: Fixed the calculation of the
          newest event offset. Removed module output when no log events are
          found.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1721 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_agents/win32/ChangeLog                          | 6 ++++++
 pandora_agents/win32/modules/pandora_module_logevent.cc | 3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog
index 61caed4195..098f107fe2 100644
--- a/pandora_agents/win32/ChangeLog
+++ b/pandora_agents/win32/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-28  Ramon Novoa  <rnovoa@artica.es>
+
+	* modules/pandora_module_logevent.cc: Fixed the calculation of the
+	  newest event offset. Removed module output when no log events are
+	  found.
+
 2009-05-25  Ramon Novoa  <rnovoa@artica.es>
 
 	* windows/pandora_wmi.cc, windows/pandora_wmi.h: Added functions for the
diff --git a/pandora_agents/win32/modules/pandora_module_logevent.cc b/pandora_agents/win32/modules/pandora_module_logevent.cc
index 974baef5f6..1c207068f0 100755
--- a/pandora_agents/win32/modules/pandora_module_logevent.cc
+++ b/pandora_agents/win32/modules/pandora_module_logevent.cc
@@ -89,7 +89,6 @@ Pandora_Module_Logevent::run () {
 	
 	// No data
 	if (event_list.size () < 1) {
-		this->setOutput ("");
 		return;
 	}
 	
@@ -166,7 +165,7 @@ Pandora_Module_Logevent::discardLogEvents () {
     // Get the offset of the newest event
     GetOldestEventLogRecord (this->log_event, &oldest_event);
     GetNumberOfEventLogRecords (this->log_event, &num_events);
-    newest_event = oldest_event + num_events;
+    newest_event = (oldest_event + num_events) - 1;
 
     // Initialize the event record buffer
     pevlr = (EVENTLOGRECORD *)&bBuffer;