summaryrefslogtreecommitdiffstats
path: root/source/python
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
commitb9eff31b1433c81fbff733e194914a40f25e3bda (patch)
tree8d64e3824ebb8eb38700e59e0745f51632768916 /source/python
parentf2c9c64900c4da24f73b188deb0f57271e3bf3e7 (diff)
downloadsamba-b9eff31b1433c81fbff733e194914a40f25e3bda.tar.gz
samba-b9eff31b1433c81fbff733e194914a40f25e3bda.tar.xz
samba-b9eff31b1433c81fbff733e194914a40f25e3bda.zip
This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd argument incorrect, so I thought it best just to remove the argument. The incorrect usage was caused by callers using strlen() to determine the length of the string. The 3rd argument to init_unistr2() was supposed to be the character length, not the byte length of the string, so for non-english this could come out wrong. I also removed the bogus 'always allocate at least 256 bytes' hack. There may be some code that relies on this, but if there is then the code is broken and needs fixing.
Diffstat (limited to 'source/python')
-rw-r--r--source/python/py_spoolss_forms.c2
-rw-r--r--source/python/py_spoolss_forms_conv.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/python/py_spoolss_forms.c b/source/python/py_spoolss_forms.c
index ef9ed94533a..b446ce3c967 100644
--- a/source/python/py_spoolss_forms.c
+++ b/source/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);
break;
}
default:
diff --git a/source/python/py_spoolss_forms_conv.c b/source/python/py_spoolss_forms_conv.c
index 095a318fd24..40f7de8fdc9 100644
--- a/source/python/py_spoolss_forms_conv.c
+++ b/source/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);
result = True;