diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-04-02 14:43:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-04-02 14:43:47 (GMT) |
commit | f9404bf68a067b06986cd85855c43795ec578dbd (patch) | |
tree | 57f481aced2c69ddf6ac9766f310be86ebe03f6f /src/debug | |
parent | d69503d7aeceddc52dfee9481e6a0e8ba9c1fc85 (diff) |
Removed lots of uninitialized uses, mostly in NDEBUG mode.
Diffstat (limited to 'src/debug')
-rw-r--r-- | src/debug/break.c | 2 | ||||
-rw-r--r-- | src/debug/gdbrsp/utils.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/debug/break.c b/src/debug/break.c index 1d4c2d3..fac3f08 100644 --- a/src/debug/break.c +++ b/src/debug/break.c @@ -124,6 +124,8 @@ virt_t get_raw_breakpoint_prev_addr(const raw_breakpoint *bp) default: + result = VMPA_NO_VIRTUAL; + found = false; for (i = 0; i < bp->count && !found; i++) 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 |