diff --git a/src/helper/log.c b/src/helper/log.c index e51943d45..da3847d4e 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -222,13 +222,12 @@ COMMAND_HANDLER(handle_log_output_command) { if (CMD_ARGC == 1) { FILE *file = NULL; - if (!strcmp(CMD_ARGV[0], ">stdout")) { + if (!strcmp(CMD_ARGV[0], ">stdout")) file = stdout; - } else if (!strcmp(CMD_ARGV[0], ">stderr")) { + else if (!strcmp(CMD_ARGV[0], ">stderr")) file = stderr; - } else { + else file = fopen(CMD_ARGV[0], "w"); - } if (file == NULL) { LOG_ERROR("failed to open output log '%s'", CMD_ARGV[0]); return ERROR_FAIL;