summaryrefslogtreecommitdiff
path: root/bin/csh/dir.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-07-12 02:47:52 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-07-12 02:47:52 +0000
commit4d490672c51f02731875195c9934210703848a75 (patch)
tree43a754c3d090cad6d7f7771a3b81ea81d7f972ba /bin/csh/dir.c
parent2e61b4f6f6435f3999b43699e17c2871541d7eb4 (diff)
If a constant string needs a name, use a static const array instead
of a pointer or non-const array, as that minimizes the symbols, maximizes the placement into read-only memory, and avoids warnings from gcc -Wformat=2 when they're used as format strings.
Diffstat (limited to 'bin/csh/dir.c')
-rw-r--r--bin/csh/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/csh/dir.c b/bin/csh/dir.c
index 05a6d39857b..2d196f4554b 100644
--- a/bin/csh/dir.c
+++ b/bin/csh/dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.c,v 1.15 2014/07/11 07:54:04 tedu Exp $ */
+/* $OpenBSD: dir.c,v 1.16 2014/07/12 02:47:51 guenther Exp $ */
/* $NetBSD: dir.c,v 1.9 1995/03/21 09:02:42 cgd Exp $ */
/*-
@@ -67,7 +67,7 @@ dinit(Char *hp)
Char *cp;
struct directory *dp;
char path[MAXPATHLEN];
- static char *emsg = "csh: Trying to start from \"%s\"\n";
+ static const char emsg[] = "csh: Trying to start from \"%s\"\n";
/* Don't believe the login shell home, because it may be a symlink */
tcp = getcwd(path, MAXPATHLEN);