talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit b5633df1b51c8a1251bae7af87b8472d3fb65ef8
parent c664620845dd076976e7cae1a6a01e76b724eaae
Author: Holger Berndt <hb@claws-mail.org>
Date:   Sun,  7 Apr 2013 16:29:40 +0200

Python plugin: const fix

It seems a bit strange for procheader_get_header_from_msginfo()
to require a non-const header string argument, though.

Diffstat:
Msrc/plugins/python/messageinfotype.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/plugins/python/messageinfotype.c b/src/plugins/python/messageinfotype.c @@ -216,6 +216,7 @@ static PyObject* get_header(PyObject *self, PyObject *args) { int retval; const char *header_str; + char *header_str_dup; MsgInfo *msginfo; gchar header_content[HEADER_CONTENT_SIZE]; @@ -225,7 +226,10 @@ static PyObject* get_header(PyObject *self, PyObject *args) msginfo = ((clawsmail_MessageInfoObject*)self)->msginfo; - if(procheader_get_header_from_msginfo(msginfo, header_content, HEADER_CONTENT_SIZE, header_str) == 0) { + header_str_dup = g_strdup(header_str); + retval = procheader_get_header_from_msginfo(msginfo, header_content, HEADER_CONTENT_SIZE, header_str); + g_free(header_str_dup); + if(retval == 0) { PyObject *header_content_object; gchar *content_start;