From 4b992717b54165368e61eeb9971340f84011f758 Mon Sep 17 00:00:00 2001 From: kc8apf Date: Thu, 21 May 2009 05:12:32 +0000 Subject: [PATCH] =?utf8?q?Author:=20=C3=98yvind=20Harboe=20=20=09-=20Allow=20target=5Fread/write=5Fbuffer=20of=20?= =?utf8?q?size=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.berlios.de/openocd/trunk@1870 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/target.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/target/target.c b/src/target/target.c index 7571e4e3..3bb2fa36 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -985,6 +985,10 @@ int target_write_buffer(struct target_s *target, u32 address, u32 size, u8 *buff return ERROR_FAIL; } + if (size == 0) { + return ERROR_OK; + } + if ((address + size - 1) < address) { /* GDB can request this when e.g. PC is 0xfffffffc*/ @@ -1060,6 +1064,10 @@ int target_read_buffer(struct target_s *target, u32 address, u32 size, u8 *buffe return ERROR_FAIL; } + if (size == 0) { + return ERROR_OK; + } + if ((address + size - 1) < address) { /* GDB can request this when e.g. PC is 0xfffffffc*/ -- 2.39.5