summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
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;
}
}