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:
kaf24@scramble.cl.cam.ac.uk committed 2005-02-20 03:52:37 +00:00
1 parent 3bef71ecbb
commit 841d10cf2c
4 files changed
+21 -36

No files matched your search

+4 -4
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.