quote: be consistent in not using C escapes for bytes
authorH. Peter Anvin <hpa@zytor.com>
Mon, 2 Jun 2008 17:38:54 +0000 (10:38 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 2 Jun 2008 17:38:54 +0000 (10:38 -0700)
We used numbers in nasm_unquote and C escapes in nasm_quote - use
numbers in both places, just in case some C compiler does something
weird with '\r' and (especially) '\n'.

quote.c

diff --git a/quote.c b/quote.c
index 67c78aa..d7a8dd7 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -90,31 +90,31 @@ char *nasm_quote(char *str, size_t len)
                *q++ = '\\';
                *q++ = c;
                break;
-           case '\a':
+           case 7:
                *q++ = '\\';
                *q++ = 'a';
                break;
-           case '\b':
+           case 8:
                *q++ = '\\';
                *q++ = 'b';
                break;
-           case '\t':
+           case 9:
                *q++ = '\\';
                *q++ = 't';
                break;
-           case '\n':
+           case 10:
                *q++ = '\\';
                *q++ = 'n';
                break;
-           case '\v':
+           case 11:
                *q++ = '\\';
                *q++ = 'v';
                break;
-           case '\f':
+           case 12:
                *q++ = '\\';
                *q++ = 'f';
                break;
-           case '\r':
+           case 13:
                *q++ = '\\';
                *q++ = 'r';
                break;