def _write_nullstring(file, string):
    """Write a null-terminated ASCII string back to the file."""
    if string:
        file.write(string.encode('ascii') + b'\x00')
    else:
        file.write(b' \x00')
