From 054b091623edcdc962e8c65066039f38edf2f814 Mon Sep 17 00:00:00 2001 From: drath Date: Sat, 5 May 2007 11:02:03 +0000 Subject: - further work on ETB decoding (not yet functional) - fixed several uses of uninitialized bits (Thanks to Vincent Palatin for finding and fixing these bugs) git-svn-id: svn://svn.berlios.de/openocd/trunk@145 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/helper/binarybuffer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/helper') diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index acc8237e..7d978915 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -354,7 +354,12 @@ int str_to_buf(char* str, int str_len, u8 *buf, int buf_len, int radix) } for (j = 0; j < CEIL(buf_len, 8); j++) - buf[j] = b256_buf[j]; + { + if (j < b256_len) + buf[j] = b256_buf[j]; + else + buf[j] = 0; + } /* mask out bits that don't belong to the buffer */ if (buf_len % 8) -- cgit v1.2.3