git » libjio » commit 3aefb8d

Initialize jdir properly in Python bindings

author Alberto Bertogli
2009-02-25 06:33:05 UTC
committer Alberto Bertogli
2009-02-25 07:48:31 UTC
parent e7abd100c45fe57426f6fe37b00a075c66e86287

Initialize jdir properly in Python bindings

Otherwise, when we do not get jdir as a parameter, it has rubbish which
causes jfsck() and jfsck_cleanup() not to find the journal directory.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

bindings/python/libjio.c +2 -2

diff --git a/bindings/python/libjio.c b/bindings/python/libjio.c
index 7dc2a9f..941d7b1 100644
--- a/bindings/python/libjio.c
+++ b/bindings/python/libjio.c
@@ -553,7 +553,7 @@ It's a wrapper to jfsck().\n");
 static PyObject *jf_jfsck(PyObject *self, PyObject *args)
 {
 	int rv;
-	char *name, *jdir;
+	char *name, *jdir = NULL;
 	struct jfsck_result res;
 	PyObject *dict;
 
@@ -599,7 +599,7 @@ It's a wrapper to jfsck_cleanup().\n");
 static PyObject *jf_jfsck_cleanup(PyObject *self, PyObject *args)
 {
 	long rv;
-	char *name, *jdir;
+	char *name, *jdir = NULL;
 
 	if (!PyArg_ParseTuple(args, "s|s:jfsck_cleanup", &name, &jdir))
 		return NULL;