diff options
Diffstat (limited to 'plugins/pychrysalide/analysis')
-rw-r--r-- | plugins/pychrysalide/analysis/db/certs.c | 2 | ||||
-rw-r--r-- | plugins/pychrysalide/analysis/routine.c | 6 | ||||
-rw-r--r-- | plugins/pychrysalide/analysis/variable.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/plugins/pychrysalide/analysis/db/certs.c b/plugins/pychrysalide/analysis/db/certs.c index 61b5f58..5fd2034 100644 --- a/plugins/pychrysalide/analysis/db/certs.c +++ b/plugins/pychrysalide/analysis/db/certs.c @@ -78,7 +78,7 @@ static bool py_certs_fill_x509_entries(PyObject *dict, x509_entries *out) { \ result = PyUnicode_Check(value); \ if (result) \ - out->dest = strdup((char *)PyUnicode_DATA(value)); \ + out->dest = strdup(PyUnicode_DATA(value)); \ else \ PyErr_Format(PyExc_TypeError, _("The %s property must be a string."), name); \ } \ diff --git a/plugins/pychrysalide/analysis/routine.c b/plugins/pychrysalide/analysis/routine.c index 1f245ae..d8b0eb7 100644 --- a/plugins/pychrysalide/analysis/routine.c +++ b/plugins/pychrysalide/analysis/routine.c @@ -301,10 +301,10 @@ static int py_binary_routine_set_name(PyObject *self, PyObject *value, void *clo routine = G_BIN_ROUTINE(pygobject_get(self)); - if (!PyUnicode_Check(value)) - g_binary_routine_set_name(routine, strdup(PyUnicode_DATA(value))); - else + if (value == Py_None) g_binary_routine_set_name(routine, NULL); + else + g_binary_routine_set_name(routine, strdup(PyUnicode_DATA(value))); return 0; diff --git a/plugins/pychrysalide/analysis/variable.c b/plugins/pychrysalide/analysis/variable.c index 030b26f..8af7e1d 100644 --- a/plugins/pychrysalide/analysis/variable.c +++ b/plugins/pychrysalide/analysis/variable.c @@ -178,10 +178,10 @@ static int py_binary_variable_set_name(PyObject *self, PyObject *value, void *cl variable = G_BIN_VARIABLE(pygobject_get(self)); - if (!PyUnicode_Check(value)) - g_binary_variable_set_name(variable, PyUnicode_DATA(value)); - else + if (value == Py_None) g_binary_variable_set_name(variable, NULL); + else + g_binary_variable_set_name(variable, PyUnicode_DATA(value)); return 0; |