]> granicus.if.org Git - yasm/commitdiff
Fix handling of numeric constants ending in a single character (h,q,b).
authorPeter Johnson <peter@tortall.net>
Thu, 11 Oct 2001 18:59:13 +0000 (18:59 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 11 Oct 2001 18:59:13 +0000 (18:59 -0000)
svn path=/trunk/yasm/; revision=273

modules/parsers/nasm/token.l.in
src/parsers/nasm/token.l.in

index 17c4a99681afa3819d30b6f8c5a206a73ce8ea4b..d5dc46afc18c1332916ebc170bf9ea8ce42488dc 100644 (file)
@@ -96,21 +96,21 @@ WS       [ \t\r]
 
     /* 10010011b - binary number */
 {BINDIGIT}+b {
-    yytext[strlen(yytext)] = '\0';  /* strip off 'b' */
+    yytext[strlen(yytext)-1] = '\0';  /* strip off 'b' */
     yylval.intn = intnum_new_bin(yytext);
     return INTNUM;
 }
 
     /* 777q - octal number */
 {OCTDIGIT}+q {
-    yytext[strlen(yytext)] = '\0';  /* strip off 'q' */
+    yytext[strlen(yytext)-1] = '\0';  /* strip off 'q' */
     yylval.intn = intnum_new_oct(yytext);
     return INTNUM;
 }
 
     /* 0AAh form of hexidecimal number */
 0{HEXDIGIT}+h {
-    yytext[strlen(yytext)] = '\0';  /* strip off 'h' */
+    yytext[strlen(yytext)-1] = '\0';  /* strip off 'h' */
     yylval.intn = intnum_new_hex(yytext);
     return INTNUM;
 }
index 17c4a99681afa3819d30b6f8c5a206a73ce8ea4b..d5dc46afc18c1332916ebc170bf9ea8ce42488dc 100644 (file)
@@ -96,21 +96,21 @@ WS       [ \t\r]
 
     /* 10010011b - binary number */
 {BINDIGIT}+b {
-    yytext[strlen(yytext)] = '\0';  /* strip off 'b' */
+    yytext[strlen(yytext)-1] = '\0';  /* strip off 'b' */
     yylval.intn = intnum_new_bin(yytext);
     return INTNUM;
 }
 
     /* 777q - octal number */
 {OCTDIGIT}+q {
-    yytext[strlen(yytext)] = '\0';  /* strip off 'q' */
+    yytext[strlen(yytext)-1] = '\0';  /* strip off 'q' */
     yylval.intn = intnum_new_oct(yytext);
     return INTNUM;
 }
 
     /* 0AAh form of hexidecimal number */
 0{HEXDIGIT}+h {
-    yytext[strlen(yytext)] = '\0';  /* strip off 'h' */
+    yytext[strlen(yytext)-1] = '\0';  /* strip off 'h' */
     yylval.intn = intnum_new_hex(yytext);
     return INTNUM;
 }