ia64/xen-unstable

changeset 966:0df367c20765

bitkeeper revision 1.620 (3fbd2125rSiOA8VTBAprJYzUwu-e6w)

xc_py.c:
Clean up one method on error return.
author kaf24@scramble.cl.cam.ac.uk
date Thu Nov 20 20:16:37 2003 +0000 (2003-11-20)
parents 7a02d0bf8d11
children a0a36d4ac8de
files tools/xc/py/xc_py.c
line diff
     1.1 --- a/tools/xc/py/xc_py.c	Thu Nov 20 19:39:12 2003 +0000
     1.2 +++ b/tools/xc/py/xc_py.c	Thu Nov 20 20:16:37 2003 +0000
     1.3 @@ -439,7 +439,6 @@ static PyObject *pyxc_readconsolering(Py
     1.4                                        PyObject *kwds)
     1.5  {
     1.6      XcObject *xc = (XcObject *)self;
     1.7 -    PyObject *pystr = Py_None;
     1.8  
     1.9      unsigned int clear = 0;
    1.10      char         str[32768];
    1.11 @@ -452,10 +451,7 @@ static PyObject *pyxc_readconsolering(Py
    1.12  
    1.13      ret = xc_readconsolering(xc->xc_handle, str, sizeof(str), clear);
    1.14  
    1.15 -    if ( ret > 0 )
    1.16 -        pystr = PyString_FromString(str);
    1.17 -    
    1.18 -    return pystr;
    1.19 +    return PyString_FromStringAndSize(str, (ret < 0) ? 0 : ret);
    1.20  }
    1.21  
    1.22  static PyMethodDef pyxc_methods[] = {