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/gdbrsp | |
parent | d69503d7aeceddc52dfee9481e6a0e8ba9c1fc85 (diff) |
Removed lots of uninitialized uses, mostly in NDEBUG mode.
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 |