Fix error in quote parsing of log entries.

This commit is contained in:
Jonathan Moore Liles 2008-04-26 21:45:24 -05:00
parent 8e1bc189e6
commit 82ada52b71
2 changed files with 11 additions and 4 deletions

View File

@ -103,7 +103,8 @@ parse_alist( const char *s )
char *pair = (char*)malloc( l + 1 ); char *pair = (char*)malloc( l + 1 );
if ( c[ strlen( c ) - 1 ] == ' ' ) /* remove trailing space */
if ( c[ l - 1 ] == ' ' )
--l; --l;
strncpy( pair, c, l ); strncpy( pair, c, l );
@ -122,10 +123,15 @@ parse_alist( const char *s )
if ( *v == '"' ) if ( *v == '"' )
{ {
// v++; // v++;
if ( v[ strlen( v ) - 1 ] != '"' )
printf( "error: invalid quoting in log entry!\n" );
else
{
v[ strlen( v ) - 1 ] = '\0'; v[ strlen( v ) - 1 ] = '\0';
memmove( v, v + 1, strlen( v ) + 1 ); memmove( v, v + 1, strlen( v ) + 1 );
} }
} }
}
c = s; c = s;

View File

@ -390,10 +390,11 @@ Region::handle ( int m )
_fade_in.type = (Fade::fade_type_e)(int)(r - &menu[2]); _fade_in.type = (Fade::fade_type_e)(int)(r - &menu[2]);
else if ( r > &menu[7] && r < &menu[12] ) else if ( r > &menu[7] && r < &menu[12] )
_fade_out.type = (Fade::fade_type_e)(int)(r - &menu[8]); _fade_out.type = (Fade::fade_type_e)(int)(r - &menu[8]);
redraw();
} }
return 1; return 1;
} }
else else
return Sequence_Widget::handle( m ); return Sequence_Widget::handle( m );