diff options
author | Tim Potter <tpot@samba.org> | 2002-05-17 02:24:06 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-17 02:24:06 +0000 |
commit | b26d9d793914b66050c374ec2c0e94fa37c7e0e4 (patch) | |
tree | c4c607f75e58d4b13b450604b225c73707333150 /source/python/py_conv.c | |
parent | d3222ecd1a024fd2e7ba72b1bc10a400d398a364 (diff) | |
download | samba-b26d9d793914b66050c374ec2c0e94fa37c7e0e4.tar.gz samba-b26d9d793914b66050c374ec2c0e94fa37c7e0e4.tar.xz samba-b26d9d793914b66050c374ec2c0e94fa37c7e0e4.zip |
to_struct() now returns a boolean which is false if not all the elements of
the structure were present in the dictionary.
Diffstat (limited to 'source/python/py_conv.c')
-rw-r--r-- | source/python/py_conv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/python/py_conv.c b/source/python/py_conv.c index 2dc12f348a7..c6f39515af1 100644 --- a/source/python/py_conv.c +++ b/source/python/py_conv.c @@ -78,7 +78,7 @@ PyObject *from_struct(void *s, struct pyconv *conv) /* Convert a Python dict to a structure */ -void to_struct(void *s, PyObject *dict, struct pyconv *conv) +BOOL to_struct(void *s, PyObject *dict, struct pyconv *conv) { int i; @@ -86,6 +86,9 @@ void to_struct(void *s, PyObject *dict, struct pyconv *conv) PyObject *obj; obj = PyDict_GetItemString(dict, conv[i].name); + + if (!obj) + return False; switch (conv[i].type) { case PY_UNISTR: { @@ -123,4 +126,6 @@ void to_struct(void *s, PyObject *dict, struct pyconv *conv) break; } } + + return True; } |