diff options
| author | Paul Eggert | 2011-08-28 16:57:19 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-08-28 16:57:19 -0700 |
| commit | 644a0faa36ad8c1e251d198c2bc69f17c8bdb83a (patch) | |
| tree | 2f241eb29829d1e533a1bdfb3b07c37ea95119b1 /lib-src | |
| parent | 9250f758254937f43a621a2371e3433ce7daa573 (diff) | |
| download | emacs-644a0faa36ad8c1e251d198c2bc69f17c8bdb83a.tar.gz emacs-644a0faa36ad8c1e251d198c2bc69f17c8bdb83a.zip | |
* 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.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 4 | ||||
| -rw-r--r-- | lib-src/movemail.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 8d46a37ce51..ca08ece7c39 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -26,6 +26,10 @@ | |||
| 26 | greater than BUFSIZ or 2*BUFSIZ + 20. Do not use sprintf when its | 26 | greater than BUFSIZ or 2*BUFSIZ + 20. Do not use sprintf when its |
| 27 | result might not fit in 'int'. | 27 | result might not fit in 'int'. |
| 28 | 28 | ||
| 29 | * movemail.c (main): Do not use sprintf when its result might not fit | ||
| 30 | in 'int'. Instead, put the possibly-long file name into the | ||
| 31 | output of pfatal_with_name. | ||
| 32 | |||
| 29 | 2011-07-28 Paul Eggert <eggert@cs.ucla.edu> | 33 | 2011-07-28 Paul Eggert <eggert@cs.ucla.edu> |
| 30 | 34 | ||
| 31 | Assume freestanding C89 headers, string.h, stdlib.h. | 35 | Assume freestanding C89 headers, string.h, stdlib.h. |
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index d70c655adec..097bf23c202 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -325,11 +325,10 @@ main (int argc, char **argv) | |||
| 325 | if (desc < 0) | 325 | if (desc < 0) |
| 326 | { | 326 | { |
| 327 | int mkstemp_errno = errno; | 327 | int mkstemp_errno = errno; |
| 328 | char *message = (char *) xmalloc (strlen (tempname) + 50); | 328 | error ("error while creating what would become the lock file", |
| 329 | sprintf (message, "creating %s, which would become the lock file", | 329 | 0, 0); |
| 330 | tempname); | ||
| 331 | errno = mkstemp_errno; | 330 | errno = mkstemp_errno; |
| 332 | pfatal_with_name (message); | 331 | pfatal_with_name (tempname); |
| 333 | } | 332 | } |
| 334 | close (desc); | 333 | close (desc); |
| 335 | 334 | ||