From 82ada52b71c41821f95a602161b2e051c8ae0837 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 26 Apr 2008 21:45:24 -0500 Subject: [PATCH] Fix error in quote parsing of log entries. --- Timeline/Loggable.C | 12 +++++++++--- Timeline/Region.C | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 9bc006a..5fc7e0c 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -103,7 +103,8 @@ parse_alist( const char *s ) char *pair = (char*)malloc( l + 1 ); - if ( c[ strlen( c ) - 1 ] == ' ' ) + /* remove trailing space */ + if ( c[ l - 1 ] == ' ' ) --l; strncpy( pair, c, l ); @@ -122,8 +123,13 @@ parse_alist( const char *s ) if ( *v == '"' ) { // v++; - v[ strlen( v ) - 1 ] = '\0'; - memmove( v, v + 1, strlen( v ) + 1 ); + if ( v[ strlen( v ) - 1 ] != '"' ) + printf( "error: invalid quoting in log entry!\n" ); + else + { + v[ strlen( v ) - 1 ] = '\0'; + memmove( v, v + 1, strlen( v ) + 1 ); + } } } diff --git a/Timeline/Region.C b/Timeline/Region.C index 55777b8..825af4c 100644 --- a/Timeline/Region.C +++ b/Timeline/Region.C @@ -390,10 +390,11 @@ Region::handle ( int m ) _fade_in.type = (Fade::fade_type_e)(int)(r - &menu[2]); else if ( r > &menu[7] && r < &menu[12] ) _fade_out.type = (Fade::fade_type_e)(int)(r - &menu[8]); + + redraw(); } return 1; - } else return Sequence_Widget::handle( m );