summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysalide/analysis/scan/core.c12
-rw-r--r--plugins/pychrysalide/analysis/scan/scanner.c6
2 files changed, 4 insertions, 14 deletions
diff --git a/plugins/pychrysalide/analysis/scan/core.c b/plugins/pychrysalide/analysis/scan/core.c
index dcf5bf8..16df9a9 100644
--- a/plugins/pychrysalide/analysis/scan/core.c
+++ b/plugins/pychrysalide/analysis/scan/core.c
@@ -37,18 +37,6 @@
-/* #include <malloc.h> */
-
-/* #include <i18n.h> */
-/* #include <arch/processor.h> */
-/* #include <core/processors.h> */
-
-/* #include "../core.h" */
-
-/* #include "../arch/processor.h" */
-
-
-
/* Inscrit un modificateur dans la liste des disponibles. */
static PyObject *py_scan_register_token_modifier(PyObject *, PyObject *);
diff --git a/plugins/pychrysalide/analysis/scan/scanner.c b/plugins/pychrysalide/analysis/scan/scanner.c
index e2d5a18..bc58c9a 100644
--- a/plugins/pychrysalide/analysis/scan/scanner.c
+++ b/plugins/pychrysalide/analysis/scan/scanner.c
@@ -76,6 +76,7 @@ static PyObject *py_content_scanner_get_filename(PyObject *, void *);
static int py_content_scanner_init(PyObject *self, PyObject *args, PyObject *kwds)
{
const char *text; /* Contenu de règles à traiter */
+ Py_ssize_t len; /* Taille de ce nom */
const char *filename; /* Fichier de définitions */
int ret; /* Bilan de lecture des args. */
GContentScanner *scanner; /* Création GLib à transmettre */
@@ -100,9 +101,10 @@ static int py_content_scanner_init(PyObject *self, PyObject *args, PyObject *kwd
/* Récupération des paramètres */
text = NULL;
+ len = 0;
filename = NULL;
- ret = PyArg_ParseTupleAndKeywords(args, kwds, "|ss", kwlist, &text, &filename);
+ ret = PyArg_ParseTupleAndKeywords(args, kwds, "|s#s", kwlist, &text, &len, &filename);
if (!ret) return -1;
/* Initialisation d'un objet GLib */
@@ -116,7 +118,7 @@ static int py_content_scanner_init(PyObject *self, PyObject *args, PyObject *kwd
if (text != NULL)
{
- if (!g_content_scanner_create_from_text(scanner, text))
+ if (!g_content_scanner_create_from_text(scanner, text, len))
{
PyErr_SetString(PyExc_ValueError, _("Unable to create content scanner."));
return -1;