Return string truncated at first null character.

def stripnull(string):
    """Return string truncated at first null character."""
    i = string.find(b'\x00')
    return string if (i < 0) else string[:i]