X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=rmac.c;h=9f52e0b49f94856e1434c7d1006ab90ede01b7df;hp=8e5f4102ce8af450dde2e8cc64ed3abf8e84b225;hb=HEAD;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; }