]> git.refcnt.org Git - colorize.git/blobdiff - colorize.c
Const pointers
[colorize.git] / colorize.c
index 63237a5240d4cf7a4e44942b9503a7db9357d5c9..d7d014ffb48f3817624b4e3fdc87531920344020 100644 (file)
@@ -339,8 +339,8 @@ main (int argc, char **argv)
           vfprintf_fail (formats[FMT_GENERIC], "--clean and --clean-all switch are mutually exclusive");
         if (arg_cnt > 1)
           {
-            const char *format = "%s %s";
-            const char *message = "switch cannot be used with more than one file";
+            const char *const format = "%s %s";
+            const char *const message = "switch cannot be used with more than one file";
             if (clean)
               vfprintf_fail (format, "--clean", message);
             else if (clean_all)
@@ -661,7 +661,11 @@ process_args (unsigned int arg_cnt, char **arg_strings, char *attr, const struct
     int ret;
     char *p;
     struct stat sb;
-    struct color_name *color_names[3] = { NULL, NULL, NULL };
+    struct color_name *color_names[3] = {
+        NULL, /* foreground */
+        NULL, /* background */
+        NULL, /* sentinel value */
+    };
 
     const char *color_string = arg_cnt >= 1 ? arg_strings[0] : NULL;
     const char *file_string  = arg_cnt == 2 ? arg_strings[1] : NULL;