From 4d490672c51f02731875195c9934210703848a75 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Sat, 12 Jul 2014 02:47:52 +0000 Subject: 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. --- bin/csh/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/csh/dir.c') 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); -- cgit v1.2.3