]> Shamusworld >> Repos - rmac/commitdiff
Fixes for bugs #211-213, submitted by Bastian Schick. :-) v2.2.14
authorShamus Hammons <jlhamm@acm.org>
Wed, 21 Dec 2022 23:19:36 +0000 (17:19 -0600)
committerShamus Hammons <jlhamm@acm.org>
Wed, 21 Dec 2022 23:19:36 +0000 (17:19 -0600)
fltpoint.c
parmode.h
rmac.c
version.h

index 7e516fbd360686985aa160bb45f7f38658c6a67a..ffde55edc1ef6ea159663cde60440b7754bf813b 100644 (file)
@@ -210,7 +210,7 @@ uint64_t DoubleToFixedPoint(double d, int intBits, int fracBits)
 
        // Invert the result, if necessary
        if (signBit == 1)
-               result = (result = 0xFFFFFFFFFFFFFFFFLL) + 1;
+               result = (result ^ 0xFFFFFFFFFFFFFFFFLL) + 1;
 
        return result;
 }
index fe0126166eff2ecd5aee667242c660d48128df38..27863d08c69f65f0886ec64c2ad6cd736cf03ecc 100644 (file)
--- a/parmode.h
+++ b/parmode.h
@@ -934,7 +934,7 @@ IS_SUPPRESSEDn:
                                        // Something really bad happened, abort
                                        return error("reached end of line while parsing expression");
                                }
-                               if (*look_ahead == '(') 
+                               if (*look_ahead == '(')
                                {
                                        if (parenthesis_level == 0)
                                        {
@@ -1221,7 +1221,7 @@ CHK_FOR_DISPn:
                        {
                                // When PC relative is enforced, check for any symbols that aren't
                                // EQU'd, in this case it's an illegal mode
-                               if ((CHECK_OPTS(OPT_PC_RELATIVE)) && (AnEXATTR & (DEFINED | REFERENCED | EQUATED) == (DEFINED | REFERENCED)))
+                               if ((CHECK_OPTS(OPT_PC_RELATIVE)) && ((AnEXATTR & (DEFINED | REFERENCED | EQUATED)) == (DEFINED | REFERENCED)))
                                        return error("relocation not allowed when o30 is enabled");
 
                                tok++;
diff --git a/rmac.c b/rmac.c
index 8e5f4102ce8af450dde2e8cc64ed3abf8e84b225..17715f7ad6c86e8f9f0c6cffced6920e7b76ae00 100644 (file)
--- a/rmac.c
+++ b/rmac.c
@@ -758,7 +758,9 @@ int Process(int argc, char ** argv)
                if (firstfname == NULL)
                        firstfname = defname;
 
-               strcpy(fnbuf, firstfname);
+               // It's the size of fnbuf minus 5 because of the possible 4 char suffix
+               // + trailing null (added by fext()).
+               strncpy(fnbuf, firstfname, sizeof(fnbuf) - 5);
                fext(fnbuf, (prg_flag ? ".prg" : ".o"), 1);
                objfname = fnbuf;
        }
index 5e60ffae772c4346bad2ef29847cf2b7b957ea22..97c3ff0f07b3a8d1a492f14a0b25f8901b4071a6 100644 (file)
--- a/version.h
+++ b/version.h
@@ -15,6 +15,6 @@
 
 #define MAJOR   2              // Major version number
 #define MINOR   2              // Minor version number
-#define PATCH   13             // Patch release number
+#define PATCH   14             // Patch release number
 
 #endif // __VERSION_H__