From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTuLK-0001E0-IB for qemu-devel@nongnu.org; Sun, 21 Apr 2013 09:30:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UTuLI-0002M1-7C for qemu-devel@nongnu.org; Sun, 21 Apr 2013 09:30:10 -0400 From: Peter Maydell Date: Sun, 21 Apr 2013 14:30:03 +0100 Message-Id: <1366551003-16649-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Blue Swirl , Anthony Liguori , patches@linaro.org Handle the addresses and values for {in,out}[bwl] as unsigned (ie with strtoul), as per the protocol specification comment. This fixes a test failure in test_i440fx_defaults on 32-bit hosts where the test tries to write 0x80000000 and qtest was instead writing 0x7fffffff. Signed-off-by: Peter Maydell --- This fixes the actual parsing error; checking strtol errors is a separate bug which should be done for the whole file. qtest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qtest.c b/qtest.c index 3bba3e5..07a9612 100644 --- a/qtest.c +++ b/qtest.c @@ -271,8 +271,8 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) uint32_t value; g_assert(words[1] && words[2]); - addr = strtol(words[1], NULL, 0); - value = strtol(words[2], NULL, 0); + addr = strtoul(words[1], NULL, 0); + value = strtoul(words[2], NULL, 0); if (words[0][3] == 'b') { cpu_outb(addr, value); @@ -290,7 +290,7 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) uint32_t value = -1U; g_assert(words[1]); - addr = strtol(words[1], NULL, 0); + addr = strtoul(words[1], NULL, 0); if (words[0][2] == 'b') { value = cpu_inb(addr); -- 1.7.10.4