From f0518396ba867ce83019494733362c5b5d05b168 Mon Sep 17 00:00:00 2001 From: Dan White Date: Tue, 14 May 2013 11:32:41 -0500 Subject: [PATCH] msp4th: bugfix o2w, save some bytes --- msp4th/msp4th.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/msp4th/msp4th.c b/msp4th/msp4th.c index 96b8e5b..432ea15 100644 --- a/msp4th/msp4th.c +++ b/msp4th/msp4th.c @@ -767,9 +767,10 @@ void opcode2wordFunc(void) // walk list to get word // skip to start of the expected location while (n < opcode) { - while (*list >= ' ') { + while (*list > ' ') { list++; } + list++; n++; } @@ -1007,7 +1008,6 @@ void printHexChar(int16_t n) void printHexByte(int16_t n) { - n &= 0xFF; printHexChar(n >> 4); printHexChar(n); } @@ -1015,7 +1015,8 @@ void printHexByte(int16_t n) void printHexWord(int16_t n) { - printHexByte(n >> 8); + // suppress sign bit extension + printHexByte((uint16_t)n >> 8); printHexByte(n); } -- 2.25.1