diff options
author | Tim Potter <tpot@samba.org> | 2002-05-20 08:09:19 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-20 08:09:19 +0000 |
commit | 641d6dc79e5d16e1fdb6c0986ea850dffddb7d86 (patch) | |
tree | b76290bc88543727fc8fc5945e8f2e49ee20c7f7 /source3/python | |
parent | 03a83917874cf699b5936aa3fee7922199b4e05e (diff) | |
download | samba-641d6dc79e5d16e1fdb6c0986ea850dffddb7d86.tar.gz samba-641d6dc79e5d16e1fdb6c0986ea850dffddb7d86.tar.bz2 samba-641d6dc79e5d16e1fdb6c0986ea850dffddb7d86.zip |
Remove level and name fields from dictionary copy in py_to_FORM()
(This used to be commit ac15442579848f145dbdce6d51207321c4150c25)
Diffstat (limited to 'source3/python')
-rw-r--r-- | source3/python/py_spoolss_forms_conv.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/python/py_spoolss_forms_conv.c b/source3/python/py_spoolss_forms_conv.c index 604777adcd..1b006cbf51 100644 --- a/source3/python/py_spoolss_forms_conv.c +++ b/source3/python/py_spoolss_forms_conv.c @@ -55,16 +55,21 @@ BOOL py_from_FORM_1(PyObject **dict, FORM_1 *form) BOOL py_to_FORM(FORM *form, PyObject *dict) { - PyObject *obj; + PyObject *obj, *dict_copy = PyDict_Copy(dict); char *name; - if (!to_struct(form, dict, py_FORM)) - return False; - if (!(obj = PyDict_GetItemString(dict, "name")) || !PyString_Check(obj)) return False; + PyDict_DelItemString(dict_copy, "level"); + PyDict_DelItemString(dict_copy, "name"); + + if (!to_struct(form, dict_copy, py_FORM)) { + Py_DECREF(dict_copy); + return False; + } + name = PyString_AsString(obj); init_unistr2(&form->name, name, strlen(name) + 1); |