diff options
author | Mariusz PluciĆski <mplucinski@mplucinski.com> | 2014-06-21 02:07:23 +0200 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2014-06-26 16:39:39 -0400 |
commit | 3e0d96af4c72ed2ab3f6650713ff24689ac936c7 (patch) | |
tree | 7fa0f9d046f19a7ab94a79024c4c7a0bbf63dee6 /src/misc.c | |
parent | c979ed27bb4389ead5e812c0336e1d0b70a3a5a8 (diff) |
Change output formats from octal to hexadecimal
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -748,7 +748,7 @@ void out_m4_define (const char* def, const char* val) char *readable_form (c) register int c; { - static char rform[10]; + static char rform[20]; if ((c >= 0 && c < 32) || c >= 127) { switch (c) { @@ -771,7 +771,10 @@ char *readable_form (c) #endif default: - snprintf (rform, sizeof(rform), "\\%.3o", (unsigned int) c); + if(trace_hex) + snprintf (rform, sizeof(rform), "\\x%.2x", (unsigned int) c); + else + snprintf (rform, sizeof(rform), "\\%.3o", (unsigned int) c); return rform; } } |