We should not call str_len(line) after line has been moved
cause this may give undesired results.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 vm/trace.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/vm/trace.c b/vm/trace.c
index 45174f0..8757070 100644
--- a/vm/trace.c
+++ b/vm/trace.c
@@ -91,8 +91,9 @@ void trace_flush(void) {
        }
 
        /* Leave the rest of characters, which are not ended by '\n' */
-       memmove(trace_buffer->value, line, strlen(line) + 1);
-       trace_buffer->length = strlen(line);
+       int len = strlen(line);
+       memmove(trace_buffer->value, line, len + 1);
+       trace_buffer->length = len;
 
        pthread_mutex_unlock(&trace_mutex);
 
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to