def fix_newlines(lines):
    """Convert newlines to unix."""
    for i, line in enumerate(lines):
        if line.endswith('\r\n'):
            lines[i] = line[:-2] + '\n'
        elif line.endswith('\r'):
            lines[i] = line[:-1] + '\n'
