mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1229 (42180985F67QALsnFjovJHWiIDEz_A)
Fix return-code checking in tools. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
3bef71ecbb
commit
841d10cf2c
4 files changed
+21
-36
No files matched your search
@@ -430,11 +430,9 @@ static PyObject *pyxc_vmx_build(PyObject *self,
|
||||
printf ("numItems: %d\n", numItems);
|
||||
mem_map.nr_map = numItems;
|
||||
|
||||
|
||||
/* should raise an error here. */
|
||||
if (numItems < 0) return NULL; /* Not a list */
|
||||
|
||||
|
||||
/* iterate over items of the list, grabbing ranges and parsing them */
|
||||
for (i = 1; i <= numItems; i++) { // skip over "memmap"
|
||||
PyObject *item, *f1, *f2, *f3, *f4;
|
||||
@@ -461,8 +459,10 @@ static PyObject *pyxc_vmx_build(PyObject *self,
|
||||
sf2 = PyString_AsString(f2);
|
||||
lf3 = PyLong_AsLong(f3);
|
||||
lf4 = PyLong_AsLong(f4);
|
||||
sscanf(sf1, "%lx", &lf1);
|
||||
sscanf(sf2, "%lx", &lf2);
|
||||
if ( sscanf(sf1, "%lx", &lf1) != 1 )
|
||||
return NULL;
|
||||
if ( sscanf(sf2, "%lx", &lf2) != 1 )
|
||||
return NULL;
|
||||
|
||||
mem_map.map[i-1].addr = lf1;
|
||||
mem_map.map[i-1].size = lf2 - lf1;
|
||||
|
||||