@@ -1272,6 +1272,7 @@ struct rgbcolor_table_S {
12721272 char_u * color_name ;
12731273 guicolor_T color ;
12741274};
1275+
12751276static struct rgbcolor_table_S rgb_table [] = {
12761277 {(char_u * )"black" , RGB (0x00 , 0x00 , 0x00 )},
12771278 {(char_u * )"blue" , RGB (0x00 , 0x00 , 0xD4 )},
@@ -1354,7 +1355,7 @@ termtrue_mch_get_color(char_u *name)
13541355 else
13551356 {
13561357 /* Check if the name is one of the colors we know */
1357- for (i = 0 ; i < sizeof (rgb_table ) / sizeof (rgb_table [0 ]); i ++ )
1358+ for (i = 0 ; i < ( int )( sizeof (rgb_table ) / sizeof (rgb_table [0 ]) ); i ++ )
13581359 if (STRICMP (name , rgb_table [i ].color_name ) == 0 )
13591360 return rgb_table [i ].color ;
13601361 }
@@ -1384,7 +1385,7 @@ termtrue_mch_get_color(char_u *name)
13841385 int pos ;
13851386 char * color ;
13861387
1387- fgets (line , LINE_LEN , fd );
1388+ ignored = fgets (line , LINE_LEN , fd );
13881389 len = strlen (line );
13891390
13901391 if (len <= 1 || line [len - 1 ] != '\n' )
@@ -2803,9 +2804,11 @@ term_bg_rgb_color(long_u rgb)
28032804 static void
28042805term_rgb_color (char_u * s , long_u rgb )
28052806{
2806- char buf [7 + 3 * 3 + 2 + 1 + 1 ];
2807+ #define MAX_COLOR_STR_LEN 100
2808+ char buf [MAX_COLOR_STR_LEN ];
28072809
2808- sprintf (buf , (char * )s , RED (rgb ), GREEN (rgb ), BLUE (rgb ));
2810+ vim_snprintf (buf , MAX_KEY_CODE_LEN ,
2811+ (char * )s , RED (rgb ), GREEN (rgb ), BLUE (rgb ));
28092812 OUT_STR (buf );
28102813}
28112814#endif
0 commit comments