summaryrefslogtreecommitdiffstats
path: root/Objects/bytearrayobject.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-09 19:25:48 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-09 19:25:48 (GMT)
commit10de93a715ecf1f1829cf65ca275c0adc0db7c01 (patch)
treeb026092551ce1e78f5c5c0b095205cd8501a01ab /Objects/bytearrayobject.c
parent34d17debb7ce054b68cf161c34d1319bee6de7cf (diff)
downloadcpython-10de93a715ecf1f1829cf65ca275c0adc0db7c01.zip
cpython-10de93a715ecf1f1829cf65ca275c0adc0db7c01.tar.gz
cpython-10de93a715ecf1f1829cf65ca275c0adc0db7c01.tar.bz2
Silence gcc warning. (In function 'bytearray_init': warning: 'value' may be used uninitialized in this function).
Diffstat (limited to 'Objects/bytearrayobject.c')
-rw-r--r--Objects/bytearrayobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 16350ff..021ab1a 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -33,6 +33,7 @@ _getbytevalue(PyObject* arg, int *value)
PyObject *index = PyNumber_Index(arg);
if (index == NULL) {
PyErr_Format(PyExc_TypeError, "an integer is required");
+ *value = -1;
return 0;
}
face_value = PyLong_AsLong(index);
@@ -42,6 +43,7 @@ _getbytevalue(PyObject* arg, int *value)
if (face_value < 0 || face_value >= 256) {
/* this includes the OverflowError in case the long is too large */
PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)");
+ *value = -1;
return 0;
}