]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/color_name.h
ncurses 6.4 - patch 20240420
[ncurses.git] / test / color_name.h
index 5ec4dcbf990e032a1c894a9de70360d707aa33fe..867396ca5f7059efd90ab3f04702715bc22dbffb 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 2011-2016,2018 Free Software Foundation, Inc.              *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2011-2012,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: color_name.h,v 1.6 2018/12/29 15:19:30 tom Exp $
+ * $Id: color_name.h,v 1.9 2021/04/24 23:25:29 tom Exp $
  */
 
 #ifndef __COLORNAME_H
@@ -36,7 +37,7 @@
 #include <test.priv.h>
 #endif
 
-static NCURSES_CONST char *the_color_names[] =
+static NCURSES_CONST char *const the_color_names[] =
 {
     "black",
     "red",
@@ -89,7 +90,7 @@ color_name(int color)
     const char *result = 0;
 
     if (color >= (int) SIZEOF(the_color_names)) {
-       _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(result)) "%d", color);
+       _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "%d", color);
        result = temp;
     } else if (color < 0) {
        result = "default";