summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorMariusz PluciƄski <mplucinski@mplucinski.com>2014-06-21 02:07:23 +0200
committerWill Estes <westes575@gmail.com>2014-06-26 16:39:39 -0400
commit3e0d96af4c72ed2ab3f6650713ff24689ac936c7 (patch)
tree7fa0f9d046f19a7ab94a79024c4c7a0bbf63dee6 /src/misc.c
parentc979ed27bb4389ead5e812c0336e1d0b70a3a5a8 (diff)
Change output formats from octal to hexadecimal
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/misc.c b/src/misc.c
index e3fdd50..cd88928 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -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;
}
}