]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(parse_ls_color): Use strcpy to initialize 3-character array.
authorJim Meyering <jim@meyering.net>
Mon, 29 Apr 1996 04:31:24 +0000 (04:31 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 29 Apr 1996 04:31:24 +0000 (04:31 +0000)
Automatic aggregate initialization isn't portable.

src/ls.c

index b8b5ba401ea4754f628dbeecf4d23cbd36147a5a..6886b72e87fe6a16cfa70f5ec8daa42bb7e02e2c 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -1290,10 +1290,11 @@ parse_ls_color (void)
   char *buf;                   /* color_buf buffer pointer */
   int state;                   /* State of parser */
   int ind_no;                  /* Indicator number */
-  char label[3] = "??";                /* Indicator label */
+  char label[3];               /* Indicator label */
   struct col_ext_type *ext;    /* Extension we are working on */
   struct col_ext_type *ext2;   /* Extra pointer */
 
+  strcpy (label, "??");
   if (((p = getenv (whichvar = "LS_COLORS")) != NULL && *p != '\0')
       || ((p = getenv (whichvar = "LS_COLOURS")) != NULL && *p != '\0'))
     {