]> Shamusworld >> Repos - rmac/blobdiff - token.c
Fix for bug where in alcyon mode the tokenizer would read past the end of the line.
[rmac] / token.c
diff --git a/token.c b/token.c
index 81a040a958aefc6971baf53ef30f8186cbc3e070..24b7c955d6cbe04591fc6d634453b629ec5be9e2 100644 (file)
--- a/token.c
+++ b/token.c
@@ -521,7 +521,7 @@ DEBUG printf("ExM: SYMBOL=\"%s\"", d);
 //         to choke on legitimate code... Need to investigate this further
 //         before changing anything else here!
                                                        case CONST:
-                                                               sprintf(numbuf, "$%lx", (LONG)*tk++);
+                                                               sprintf(numbuf, "$%lx", (long unsigned int)*tk++);
                                                                d = numbuf;
                                                                break;
                                                        case DEQUALS:
@@ -648,7 +648,6 @@ char * GetNextMacroLine(void)
 //
 char * GetNextRepeatLine(void)
 {
-
        IREPT * irept = cur_inobj->inobj.irept;
        LONG * strp = irept->ir_nextln;                 // initial null
 
@@ -1304,16 +1303,19 @@ dostring:
 
                                        if (obj_format == ALCYON)
                                        {
-                                               if ((*(ln + 1) == 'w') || (*(ln + 1) == 'W'))
-                                               {
-                                                       *tk++ = DOTW;
-                                                       ln += 2;
-                                               }
-                                               else if ((*(ln + 1) == 'l') || (*(ln + 1) == 'L'))
-                                               {
-                                                       *tk++ = DOTL;
-                                                       ln += 2;
-                                               }
+                        if (*ln == '.')
+                        {
+                            if ((*(ln + 1) == 'w') || (*(ln + 1) == 'W'))
+                            {
+                                *tk++ = DOTW;
+                                ln += 2;
+                            }
+                            else if ((*(ln + 1) == 'l') || (*(ln + 1) == 'L'))
+                            {
+                                *tk++ = DOTL;
+                                ln += 2;
+                            }
+                        }
                                        }
                                }
                                else