git: e163cae76ec7 - main - Make calendarhome buffer static

Stefan Eßer se at FreeBSD.org
Wed Dec 30 12:45:56 UTC 2020


The branch main has been updated by se:

URL: https://cgit.FreeBSD.org/src/commit/?id=e163cae76ec73bb5e20185c066518ec646d0f34f

commit e163cae76ec73bb5e20185c066518ec646d0f34f
Author:     Stefan Eßer <se at FreeBSD.org>
AuthorDate: 2020-12-30 12:42:48 +0000
Commit:     Stefan Eßer <se at FreeBSD.org>
CommitDate: 2020-12-30 12:44:33 +0000

    Make calendarhome buffer static
    
    the value may be used in error messages after leaving this function.
---
 usr.bin/calendar/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index adea085cf3da..24966399c179 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -122,7 +122,7 @@ cal_fopen(const char *file)
 	unsigned int i;
 	struct stat sb;
 	static bool warned = false;
-	char calendarhome[MAXPATHLEN];
+	static char calendarhome[MAXPATHLEN];
 
 	if (home == NULL || *home == '\0') {
 		warnx("Cannot get home directory");


More information about the dev-commits-src-all mailing list