]> git.eshelyaron.com Git - emacs.git/commitdiff
(main): When making tempname, cast result of xmalloc.
authorRichard M. Stallman <rms@gnu.org>
Fri, 24 Dec 1993 02:17:52 +0000 (02:17 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 24 Dec 1993 02:17:52 +0000 (02:17 +0000)
Include room for EXXXXXX in the size.
Don't use result of strcpy.

lib-src/movemail.c

index a391a9dd783a632f06e0eacbbfafcab79e0e8b0f..60b10b27b43050c7b736cd797583a7c292306abd 100644 (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--;