commit dbee2b5b8c5d4f6bcfdfcda4272a11719a6b01f0 Author: Martin Szulecki Date: Sat Apr 18 22:53:48 2009 +0200 Make the Python binding return a correctly sized string from as_data() diff --git a/swig/plist.i b/swig/plist.i index 5987b77..4f21c8f 100644 --- a/swig/plist.i +++ b/swig/plist.i @@ -172,11 +172,11 @@ typedef struct { return d; } - char* as_data() { - char* v; + PyObject* as_data() { + char* v = NULL; uint64_t l; plist_get_data_val($self->node, &v, &l); - return v; + return PyString_FromStringAndSize(v, l); } plist_type get_type() {