X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=rmac.c;h=9f52e0b49f94856e1434c7d1006ab90ede01b7df;hp=d9158f4c82e63016daa6bd8c4e36655ece011c1d;hb=HEAD;hpb=c6808e75ed6088e3006c0d6748c1288eebb39c8a diff --git a/rmac.c b/rmac.c index d9158f4..17715f7 100644 --- a/rmac.c +++ b/rmac.c @@ -62,6 +62,7 @@ int activefpu = FPU_NONE; // Active FPU (none by default) int org68k_active = 0; // .org switch for 68k (only with RAW output format) uint32_t org68k_address; // .org for 68k int correctMathRules; // 1, use C operator precedence in expressions +uint32_t used_architectures; // Bitmask that records exactly which architectures were used during assembly // // Convert a string to uppercase @@ -377,6 +378,7 @@ int Process(int argc, char ** argv) regcheck = reg68check; // Idem regaccept = reg68accept; // Idem correctMathRules = 0; // respect operator precedence + used_architectures = 0; // Initialise used architectures bitfield // Initialize modules InitSymbolTable(); // Symbol table InitTokenizer(); // Tokenizer @@ -756,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; }