def _parse_strings_buf(buf):
    'Helper to parse the data returned by getargs(3) and getevars(3)\n\n    `buf` is an ffi.buffer of the char[] with strings ending in \x00.\n    The last string ends in \x00\x00.  If the last string is not found\n    then an OverflowError is raised.\n    '
    strings = []
    curr = []
    prev = None
    for char in buf:
        if char == b'\x00':
            if prev == char:
                return strings
            strings.append(b''.join(curr))
            curr = []
        else:
            curr.append(char)
        prev = char
    raise OverflowError('Buffer did not contain final "\x00\x00"')
