summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-09-29 06:17:09 +0000
committerTim Potter <tpot@samba.org>2003-09-29 06:17:09 +0000
commit5400952f7f74d6e656fcf4ded173868ecec3cb77 (patch)
tree24ac373cfcffe454faaac14ffd7c8f572d7c2c63 /source3/python
parent64dbd7cbff3fa7a4e560571ec38207a7176e4646 (diff)
downloadsamba-5400952f7f74d6e656fcf4ded173868ecec3cb77.tar.gz
samba-5400952f7f74d6e656fcf4ded173868ecec3cb77.tar.bz2
samba-5400952f7f74d6e656fcf4ded173868ecec3cb77.zip
Merge from 3.0:
>Fix for #480. Change the interface for init_unistr2 to not take a length >but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string. >This is not the case. Count it after conversion. >Jeremy. (This used to be commit e2ab9e54cd0ec0002175cf18ff364f4aebaf85a0)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_spoolss_forms.c2
-rw-r--r--source3/python/py_spoolss_forms_conv.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source3/python/py_spoolss_forms.c b/source3/python/py_spoolss_forms.c
index ef9ed94533..66a6540e07 100644
--- a/source3/python/py_spoolss_forms.c
+++ b/source3/python/py_spoolss_forms.c
@@ -59,7 +59,7 @@ PyObject *spoolss_hnd_addform(PyObject *self, PyObject *args, PyObject *kw)
PyObject *obj = PyDict_GetItemString(info, "name");
char *form_name = PyString_AsString(obj);
- init_unistr2(&form.name, form_name, strlen(form_name) + 1);
+ init_unistr2(&form.name, form_name, UNI_STR_TERMINATE);
break;
}
default:
diff --git a/source3/python/py_spoolss_forms_conv.c b/source3/python/py_spoolss_forms_conv.c
index 095a318fd2..ede729cad3 100644
--- a/source3/python/py_spoolss_forms_conv.c
+++ b/source3/python/py_spoolss_forms_conv.c
@@ -81,7 +81,7 @@ BOOL py_to_FORM(FORM *form, PyObject *dict)
obj = PyDict_GetItemString(dict, "name");
name = PyString_AsString(obj);
- init_unistr2(&form->name, name, strlen(name) + 1);
+ init_unistr2(&form->name, name, UNI_STR_TERMINATE);
result = True;