shouldn't write to strings that are initialized
authorewt <devnull@localhost>
Mon, 19 Feb 1996 16:29:15 +0000 (16:29 +0000)
committerewt <devnull@localhost>
Mon, 19 Feb 1996 16:29:15 +0000 (16:29 +0000)
CVS patchset: 322
CVS date: 1996/02/19 16:29:15

query.c

diff --git a/query.c b/query.c
index c964b6d..6b4a817 100644 (file)
--- 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);