changeset 532:5d627512b474

Fix the octal parsing logic I broke in changeset 506 and partially fixed in changeset 512. (And this is why I didn't want to make any changes bigger than that until I got it back together enough to test said changes.)
author Rob Landley <rob@landley.net>
date Sun, 09 Dec 2007 14:36:32 -0600
parents 56fa8cc1b112
children 8a4ec3a0e206
files tcc.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Sun Dec 09 03:32:56 2007 -0600
+++ b/tcc.c	Sun Dec 09 14:36:32 2007 -0600
@@ -2192,10 +2192,12 @@
             break;
         if (c == '\\') {
             /* at most three octal digits */
+            p++;
             for (i = c = 0; i<3; i++) {
-                n = *(++p);
+                n = *p;
                 if (n<'0' || n>'7') break;
-                n = c*8+n-'0';
+                p++;
+                c = c*8+n-'0';
             }
             if (i) goto add_char_nonext;
             switch(*p) {