diff Modules/bsddbmodule.c @ 61195:7ee562ccea80 legacy-trunk

Fix two potential uninitialization errors and an unneeded assignment. Found using Clang's static analyzer.
author Brett Cannon <bcannon@gmail.com>
date Mon, 03 May 2010 23:57:15 +0000
parents 52294af4b663
children fd25030223b0
line wrap: on
line diff
--- a/Modules/bsddbmodule.c	Mon May 03 23:51:28 2010 +0000
+++ b/Modules/bsddbmodule.c	Mon May 03 23:57:15 2010 +0000
@@ -270,11 +270,12 @@
 {
 	int status;
 	DBT krec, drec;
-	char *data,buf[4096];
+	char *data = NULL;
+	char buf[4096];
 	int size;
 	PyObject *result;
 	recno_t recno;
-	
+
 	if (dp->di_type == DB_RECNO) {
 		if (!PyArg_Parse(key, "i", &recno)) {
 			PyErr_SetString(PyExc_TypeError,
@@ -503,7 +504,8 @@
 {
 	int status;
 	DBT krec, drec;
-	char *data,buf[4096];
+	char *data = NULL;
+	char buf[4096];
 	int size;
 	PyObject *result;
 	recno_t recno;
@@ -635,7 +637,7 @@
 		PyErr_SetFromErrno(BsddbError);
 		return NULL;
 	}
-	return PyInt_FromLong(status = 0);
+	return PyInt_FromLong(0);
 }
 static PyMethodDef bsddb_methods[] = {
 	{"close",		(PyCFunction)bsddb_close, METH_NOARGS},