fix test condition of log_fp() to avoid segfault