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