diff options
Diffstat (limited to 'src/debug/gdbrsp')
-rw-r--r-- | src/debug/gdbrsp/utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/debug/gdbrsp/utils.c b/src/debug/gdbrsp/utils.c index 8c4cb8a..f1f1c85 100644 --- a/src/debug/gdbrsp/utils.c +++ b/src/debug/gdbrsp/utils.c @@ -85,7 +85,7 @@ bool read_fixed_byte(const char *data, size_t len, uint8_t *byte) len = MIN(2, len); - for (i = 0, iter = data; i < len && result; i++, iter++) + for (i = 0, iter = data; i < len; i++, iter++) { switch (*iter) { @@ -107,6 +107,9 @@ bool read_fixed_byte(const char *data, size_t len, uint8_t *byte) } + if (!result) + break; + if (i == 0) *byte = (nibble << 4); else |