def strip_cstring(data: bytes) -> str:
    """Strip strings to the first null, and convert to ascii.
    
    The CmdSeq files appear to often have junk data in the unused
    sections after the null byte, where C code doesn't touch.
    """
    if b'\0' in data:
        return data[:data.index(b'\0')].decode('ascii')
    else:
        return data.decode('ascii')