From b581648217713662c57b565f390805c4557fe30e Mon Sep 17 00:00:00 2001 From: ewt Date: Mon, 19 Feb 1996 16:29:15 +0000 Subject: [PATCH] shouldn't write to strings that are initialized CVS patchset: 322 CVS date: 1996/02/19 16:29:15 --- query.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/query.c b/query.c index c964b6d..6b4a817 100644 --- a/query.c +++ b/query.c @@ -186,7 +186,7 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode, unsigned int mtime, unsigned short rdev, char * owner, char * group, int uid, int gid, char * linkto) { - char * perms = "----------"; + char perms[11]; char sizefield[15]; char ownerfield[9], groupfield[9]; char timefield[100] = ""; @@ -196,6 +196,8 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode, static int thisMonth = 0; struct tm * tstruct; char * namefield = name; + + strcpy(perms, "----------"); if (!thisYear) { currenttime = time(NULL); -- 2.7.4