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/yylex.c | |
parent | c979ed27bb4389ead5e812c0336e1d0b70a3a5a8 (diff) |
Change output formats from octal to hexadecimal
Diffstat (limited to 'src/yylex.c')
-rw-r--r-- | src/yylex.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/yylex.c b/src/yylex.c index f06e5e6..73d371f 100644 --- a/src/yylex.c +++ b/src/yylex.c @@ -150,11 +150,12 @@ int yylex () break; default: - if (!isascii (yylval) || !isprint (yylval)) - fprintf (stderr, - "\\%.3o", - (unsigned int) yylval); - else + if (!isascii (yylval) || !isprint (yylval)) { + if(trace_hex) + fprintf (stderr, "\\x%02x", (unsigned int) yylval); + else + fprintf (stderr, "\\%.3o", (unsigned int) yylval); + } else (void) putc (yylval, stderr); break; } |