summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-08-10 18:51:23 +0100
committerJosé Fonseca <[email protected]>2008-08-12 11:34:40 +0100
commite5a606883f24980dd8e2378c25e6fb3b8f1937ce (patch)
tree8804d905b4f91de25f4cc0956574adf2ffaa3147 /src/gallium/drivers/trace
parent94cf4f15c3a94311ffeb670459e285d2c70a5d7e (diff)
trace: Fix hexadecimal dumping.
Diffstat (limited to 'src/gallium/drivers/trace')
-rw-r--r--src/gallium/drivers/trace/tr_dump.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index f545de30f4f..5269c4ddc84 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -276,17 +276,16 @@ void trace_dump_bytes(struct trace_stream *stream,
const void *data,
long unsigned size)
{
- static char hex_table[] = "0123456789ABCDE";
+ static const char hex_table[16] = "0123456789ABCDEF";
const uint8_t *p = data;
long unsigned i;
trace_dump_write(stream, "<bytes>");
for(i = 0; i < size; ++i) {
uint8_t byte = *p++;
- char str[3];
- str[0] = hex_table[byte >> 4];
- str[1] = hex_table[byte & 0xf];
- str[2] = 0;
- trace_dump_write(stream, str);
+ char hex[2];
+ hex[0] = hex_table[byte >> 4];
+ hex[1] = hex_table[byte & 0xf];
+ trace_stream_write(stream, hex, 2);
}
trace_dump_write(stream, "</bytes>");
}