1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

(main): When making tempname, cast result of xmalloc.

Include room for EXXXXXX in the size.
Don't use result of strcpy.
This commit is contained in:
Richard M. Stallman 1993-12-24 02:17:52 +00:00
parent 7694a0c4c2
commit 3f628ebde4

View file

@ -185,7 +185,8 @@ main (argc, argv)
to bug-gnu-emacs@prep.ai.mit.edu so we can fix it. */
lockname = concat (inname, ".lock", "");
tempname = strcpy (xmalloc (strlen (inname)+1), inname);
tempname = (char *) xmalloc (strlen (inname) + strlen ("EXXXXXX") + 1);
strcpy (tempname, inname);
p = tempname + strlen (tempname);
while (p != tempname && p[-1] != '/')
p--;