summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
Diffstat (limited to 'src/target')
-rw-r--r--src/target/target.c8
1 files changed, 8 insertions, 0 deletions
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*/