X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=rmac.c;fp=rmac.c;h=17715f7ad6c86e8f9f0c6cffced6920e7b76ae00;hp=8e5f4102ce8af450dde2e8cc64ed3abf8e84b225;hb=64dd9e00ec4aebc63fbddaf9dcc54b04fc9d5859;hpb=41a8ca9921f49fc9f238e3c1aaf0ce44a9fc1043 diff --git a/rmac.c b/rmac.c index 8e5f410..17715f7 100644 --- 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; }