]> git.eshelyaron.com Git - emacs.git/commitdiff
* movemail.c (main): Do not use sprintf when its result might not fit
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 28 Aug 2011 23:57:19 +0000 (16:57 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 28 Aug 2011 23:57:19 +0000 (16:57 -0700)
in 'int'.  Instead, put the possibly-long file name into the
output of pfatal_with_name.

lib-src/ChangeLog
lib-src/movemail.c

index 8d46a37ce5109c2afa5a9c7b6a53076c534dacf9..ca08ece7c39a8ecebdaecd3b4f2d90734e1b3200 100644 (file)
        greater than BUFSIZ or 2*BUFSIZ + 20. Do not use sprintf when its
        result might not fit in 'int'.
 
+       * movemail.c (main): Do not use sprintf when its result might not fit
+       in 'int'.  Instead, put the possibly-long file name into the
+       output of pfatal_with_name.
+
 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        Assume freestanding C89 headers, string.h, stdlib.h.
index d70c655adec294ee4aa65439784ba609678305c9..097bf23c2029f6000acbe41f9d38582bbf95d70f 100644 (file)
@@ -325,11 +325,10 @@ main (int argc, char **argv)
          if (desc < 0)
            {
              int mkstemp_errno = errno;
-             char *message = (char *) xmalloc (strlen (tempname) + 50);
-             sprintf (message, "creating %s, which would become the lock file",
-                      tempname);
+             error ("error while creating what would become the lock file",
+                    0, 0);
              errno = mkstemp_errno;
-             pfatal_with_name (message);
+             pfatal_with_name (tempname);
            }
          close (desc);