diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-01-08 23:42:44 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-01-08 23:42:44 (GMT) |
commit | 43f249445c9c69b9eabeea8be08b6b55a474f1fc (patch) | |
tree | d2ef7c1c464c13fb3fbd8c44b233b83a12df09a1 /plugins/pychrysalide/analysis/db/items/comment.c | |
parent | 70dce9d37e6b38c5bee7cfe175dcebd021e3a148 (diff) |
Fixed the link between native and Python locations.
Diffstat (limited to 'plugins/pychrysalide/analysis/db/items/comment.c')
-rw-r--r-- | plugins/pychrysalide/analysis/db/items/comment.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/pychrysalide/analysis/db/items/comment.c b/plugins/pychrysalide/analysis/db/items/comment.c index 6d05403..6a9f990 100644 --- a/plugins/pychrysalide/analysis/db/items/comment.c +++ b/plugins/pychrysalide/analysis/db/items/comment.c @@ -71,7 +71,7 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject int repeatable; /* Note une répétition demandée*/ const char *text; /* Eventuel premier commentaire*/ int before; /* Indication sur l'emplacement*/ - vmpa2t addr; /* Emplacement ciblé */ + vmpa2t *addr; /* Emplacement ciblé */ unsigned long flags; /* Identifiants de ligne visée */ int ret; /* Bilan de lecture des args. */ GDbComment *comment; /* Version GLib du commentaire */ @@ -92,26 +92,34 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject if (flags > BLF_ALL) { + clean_vmpa_arg(addr); + PyErr_SetString(PyExc_ValueError, _("Invalid flag combination")); return NULL; + } if ((repeatable == -1 && before == -1) || (repeatable != -1 && before != -1)) { + clean_vmpa_arg(addr); + PyErr_SetString(PyExc_ValueError, _("repeatable or before has to be defined")); return NULL; + } /* Construction */ if (repeatable) - comment = g_db_comment_new_inlined(&addr, flags, repeatable); + comment = g_db_comment_new_inlined(addr, flags, repeatable); else - comment = g_db_comment_new_area(&addr, flags, text, before); + comment = g_db_comment_new_area(addr, flags, text, before); result = pygobject_new(G_OBJECT(comment)); g_object_unref(comment); + clean_vmpa_arg(addr); + return result; } |