From 10379ee810238a765bf94a4ba48e4fff04fc7b6f Mon Sep 17 00:00:00 2001 From: yaworsky Date: Mon, 31 Oct 2005 13:20:45 +0000 Subject: Clarified loop. --- daemon/dest_file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/daemon/dest_file.c b/daemon/dest_file.c index cbf1cc1..a1e917b 100644 --- a/daemon/dest_file.c +++ b/daemon/dest_file.c @@ -452,11 +452,15 @@ static void put_message_to_file_dest( struct destination* destination, struct me EnterCriticalSection( &extra->cs_file_writers ); /* find existing writer */ for( writer = NULL, item = extra->file_writers; item; item = item->next ) - if( strcmp( ((struct file_writer*) (item->data))->file_name, file_name ) == 0 ) + { + struct file_writer *w = item->data; + + if( strcmp( w->file_name, file_name ) == 0 ) { - writer = item->data; + writer = w; break; } + } if( !writer ) { /* create new writer */ -- cgit v1.2.3