Skip to content

Commit 380130f

Browse files
committed
patch 7.4.1773
Problem: Compiler warnings. (Dominique Pelle) Solution: Add UNUSED. Add type cast. Avoid a buffer overflow.
1 parent 54a3841 commit 380130f

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/syntax.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9545,8 +9545,8 @@ highlight_gui_started(void)
95459545
static void
95469546
gui_do_one_color(
95479547
int idx,
9548-
int do_menu, /* TRUE: might set the menu font */
9549-
int do_tooltip) /* TRUE: might set the tooltip font */
9548+
int do_menu UNUSED, /* TRUE: might set the menu font */
9549+
int do_tooltip UNUSED) /* TRUE: might set the tooltip font */
95509550
{
95519551
int didit = FALSE;
95529552

src/term.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,7 @@ struct rgbcolor_table_S {
12721272
char_u *color_name;
12731273
guicolor_T color;
12741274
};
1275+
12751276
static 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
28042805
term_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

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1773,
756758
/**/
757759
1772,
758760
/**/

0 commit comments

Comments
 (0)