diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-06-07 13:38:16 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-06-07 14:33:26 -0700 |
commit | 8fcfec5f7f80d521aad34b6b503455de2b84bbc2 (patch) | |
tree | 1246d90348c88cb2a1f084694930cfa2562ad5ff /common/printf.c | |
parent | 20d730b322fde1a5785b493a99a3b702cef2f793 (diff) | |
download | chrome-ec-8fcfec5f7f80d521aad34b6b503455de2b84bbc2.tar.gz |
Fix printing hex numbers
Off-by-one is not my friend.
BUG=chrome-os-partner:10206
TEST=manual
1. rw 0x20000000
2. ww back the same number printed
3. rw 0x20000000. should match
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: I61e0d26cf4cb274a88326d4e7d24ff1c82d6e515
Reviewed-on: https://gerrit.chromium.org/gerrit/24756
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/printf.c')
-rw-r--r-- | common/printf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/printf.c b/common/printf.c index af393daa0b..d6b0298034 100644 --- a/common/printf.c +++ b/common/printf.c @@ -163,9 +163,9 @@ int vfnprintf(int (*addchar)(void *context, int c), void *context, if (digit < 10) *(--vstr) = '0' + digit; else if (c == 'X') - *(--vstr) = 'A' + digit - 9; + *(--vstr) = 'A' + digit - 10; else - *(--vstr) = 'a' + digit - 9; + *(--vstr) = 'a' + digit - 10; } if (is_negative) |