added several buffers to printBitsPar

This commit is contained in:
merlokk 2018-01-29 19:38:52 +02:00
commit a965ed1b13

View file

@ -357,8 +357,14 @@ char * printBits(size_t const size, void const * const ptr)
} }
char * printBitsPar(const uint8_t *b, size_t len) { char * printBitsPar(const uint8_t *b, size_t len) {
static char buf[1024] = {0}; static char buf1[512] = {0};
memset(buf, 0x00, 1024); static char buf2[512] = {0};
static char *buf;
if (buf != buf1)
buf = buf1;
else
buf = buf2;
memset(buf, 0x00, 512);
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
buf[i] = ((b[i / 8] << (i % 8)) & 0x80) ? '1':'0'; buf[i] = ((b[i / 8] << (i % 8)) & 0x80) ? '1':'0';