Fix:Core:Don't crash on failure to open log file
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 24 May 2008 11:21:33 +0000 (11:21 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 24 May 2008 11:21:33 +0000 (11:21 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1077 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/log.c

index 0101d11..378b446 100644 (file)
@@ -107,6 +107,8 @@ log_flush(struct log *this_)
                        return;
                log_open(this_);
        }
+       if (! this_->f)
+               return;
        if (this_->empty) {
                if (this_->header.len) 
                        fwrite(this_->header.data, 1, this_->header.len, this_->f);