From: Julien Kerihuel Date: Mon, 31 Jan 2011 16:30:24 +0000 (+0000) Subject: Retrieve value within uint32_t before casting it to MAPISTORE_DFLT_FOLDERS enum X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=437522e9aa14f00076fa135dac33433180453973;p=jelmer%2Fopenchange.git Retrieve value within uint32_t before casting it to MAPISTORE_DFLT_FOLDERS enum --- diff --git a/pyopenchange/pymapistoredb.c b/pyopenchange/pymapistoredb.c index 9343c2ed..d265871e 100644 --- a/pyopenchange/pymapistoredb.c +++ b/pyopenchange/pymapistoredb.c @@ -95,16 +95,18 @@ static PyObject *py_MAPIStoreDB_get_mapistore_uri(PyObject *module, PyObject *ar const char * const kwnames[] = { "folder", "username", "namespace", NULL }; enum MAPISTORE_ERROR retval; enum MAPISTORE_DFLT_FOLDERS dflt_folder; + uint32_t folder_int; const char *username; const char *ns; char *uri; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iss", discard_const_p(char *, kwnames), - &dflt_folder, &username, &ns)) { + &folder_int, &username, &ns)) { return NULL; } + dflt_folder = (enum MAPISTORE_DFLT_FOLDERS)folder_int; retval = mapistoredb_get_mapistore_uri(self->mdb_ctx, dflt_folder, ns, username, &uri); if (retval == MAPISTORE_SUCCESS && uri != NULL) { ret = PyString_FromString(uri);