[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 14e00d9 2/3: Mark the return value from strerror as a constant
From: |
Lars Ingebrigtsen |
Subject: |
master 14e00d9 2/3: Mark the return value from strerror as a constant |
Date: |
Wed, 14 Oct 2020 01:01:55 -0400 (EDT) |
branch: master
commit 14e00d95c4edb724bd12357e37dd443d785c1170
Author: Philipp Klaus Krause <pkk@spth.de>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Mark the return value from strerror as a constant
* src/emacs.c (main): Mark the return from strerror as a constant,
since it shouldn't be changed (bug#43982).
* lib-src/movemail.c (pfatal_and_delete): Ditto.
Copyright-paperwork-exempt: yes
---
lib-src/movemail.c | 2 +-
src/emacs.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 8016a4e..4f9abc9 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -580,7 +580,7 @@ pfatal_with_name (char *name)
static void
pfatal_and_delete (char *name)
{
- char *s = strerror (errno);
+ const char *s = strerror (errno);
unlink (name);
fatal ("%s for %s", s, name);
}
diff --git a/src/emacs.c b/src/emacs.c
index 6ed970b..e9e9661 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1273,7 +1273,7 @@ main (int argc, char **argv)
|| (fcntl (STDIN_FILENO, F_DUPFD_CLOEXEC, STDOUT_FILENO)
!= STDOUT_FILENO))
{
- char *errstring = strerror (errno);
+ const char *errstring = strerror (errno);
fprintf (stderr, "%s: %s: %s\n", argv[0], term, errstring);
exit (EXIT_FAILURE);
}