summaryrefslogtreecommitdiff
path: root/test/color_name.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2020-02-12 02:21:21 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2020-02-12 02:21:21 +0000
commitff448436b2b70771d09b8d5ff34a509dcf02f81b (patch)
tree2f7abbba7198a4e1c4a23955bc3a539db5a7d999 /test/color_name.h
parentf6d73a10a980bc78969c3af93665cbe7d06c3646 (diff)
downloadncurses-ff448436b2b70771d09b8d5ff34a509dcf02f81b.tar.gz
ncurses-6.2ncurses-6.2
Diffstat (limited to 'test/color_name.h')
-rw-r--r--test/color_name.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/color_name.h b/test/color_name.h
index 81a3b31..0dadd2a 100644
--- a/test/color_name.h
+++ b/test/color_name.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2011,2012 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 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.4 2012/11/18 01:59:32 tom Exp $
+ * $Id: color_name.h,v 1.7 2020/02/02 23:34:34 tom Exp $
*/
#ifndef __COLORNAME_H
@@ -79,7 +80,7 @@ color_code(const char *color)
}
return result;
}
-#endif /* NEED_COLOR_NAME */
+#endif /* NEED_COLOR_CODE */
#ifdef NEED_COLOR_NAME
static const char *
@@ -89,7 +90,7 @@ color_name(int color)
const char *result = 0;
if (color >= (int) SIZEOF(the_color_names)) {
- sprintf(temp, "%d", color);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(result)) "%d", color);
result = temp;
} else if (color < 0) {
result = "default";