Use readline() in read_config_file() instead of fgets.