New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pybind/rados: add rados_service_*() #18812
Conversation
Never mind, saw the link to the other PR. |
""" | ||
service = cstr(service, 'service') | ||
daemon = cstr(daemon, 'daemon') | ||
metadata_dict = '\0'.join(chain.from_iterable(metadata.items())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do these dict inputs need a trailing '\0' added for the c call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i inspected the concat'ed string using gdb, it does have two trailing \0
s.
(gdb) p/c (char[24])*metadata_dict
$12 = {118 'v', 101 'e', 114 'r', 115 's', 105 'i', 111 'o', 110 'n', 0 '\000', 51 '3', 46 '.', 49 '1', 52 '4', 0 '\000',
109 'm', 101 'e', 109 'm', 111 'o', 114 'r', 121 'y', 0 '\000', 52 '4', 50 '2', 0 '\000', 0 '\000'}
but you are right. we can not rely on this.
Signed-off-by: Kefu Chai <kchai@redhat.com>
3de693a
to
8316f32
Compare
@jdurgin fixed and repushed. |
Signed-off-by: Kefu Chai kchai@redhat.com