To: vim_dev@googlegroups.com Subject: Patch 7.4.17 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1773 (after 7.4.1770) Problem: Compiler warnings. (Dominique Pelle) Solution: Add UNUSED. Add type cast. Avoid a buffer overflow. Files: src/syntax.c, src/term.c *** ../vim-7.4.1772/src/syntax.c 2016-04-21 21:08:11.793948968 +0200 --- src/syntax.c 2016-04-22 11:05:26.776199811 +0200 *************** *** 9545,9552 **** static void gui_do_one_color( int idx, ! int do_menu, /* TRUE: might set the menu font */ ! int do_tooltip) /* TRUE: might set the tooltip font */ { int didit = FALSE; --- 9545,9552 ---- static void gui_do_one_color( int idx, ! int do_menu UNUSED, /* TRUE: might set the menu font */ ! int do_tooltip UNUSED) /* TRUE: might set the tooltip font */ { int didit = FALSE; *** ../vim-7.4.1772/src/term.c 2016-04-21 21:08:11.797948928 +0200 --- src/term.c 2016-04-22 11:21:23.102459378 +0200 *************** *** 1272,1277 **** --- 1272,1278 ---- char_u *color_name; guicolor_T color; }; + static struct rgbcolor_table_S rgb_table[] = { {(char_u *)"black", RGB(0x00, 0x00, 0x00)}, {(char_u *)"blue", RGB(0x00, 0x00, 0xD4)}, *************** *** 1354,1360 **** else { /* Check if the name is one of the colors we know */ ! for (i = 0; i < sizeof(rgb_table) / sizeof(rgb_table[0]); i++) if (STRICMP(name, rgb_table[i].color_name) == 0) return rgb_table[i].color; } --- 1355,1361 ---- else { /* Check if the name is one of the colors we know */ ! for (i = 0; i < (int)(sizeof(rgb_table) / sizeof(rgb_table[0])); i++) if (STRICMP(name, rgb_table[i].color_name) == 0) return rgb_table[i].color; } *************** *** 1384,1390 **** int pos; char *color; ! fgets(line, LINE_LEN, fd); len = strlen(line); if (len <= 1 || line[len-1] != '\n') --- 1385,1391 ---- int pos; char *color; ! ignored = fgets(line, LINE_LEN, fd); len = strlen(line); if (len <= 1 || line[len-1] != '\n') *************** *** 2803,2811 **** static void term_rgb_color(char_u *s, long_u rgb) { ! char buf[7+3*3+2+1+1]; ! sprintf(buf, (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb)); OUT_STR(buf); } #endif --- 2804,2814 ---- static void term_rgb_color(char_u *s, long_u rgb) { ! #define MAX_COLOR_STR_LEN 100 ! char buf[MAX_COLOR_STR_LEN]; ! vim_snprintf(buf, MAX_KEY_CODE_LEN, ! (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb)); OUT_STR(buf); } #endif *** ../vim-7.4.1772/src/version.c 2016-04-22 10:14:01.003848576 +0200 --- src/version.c 2016-04-22 11:22:18.497894688 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1773, /**/ -- A poem: read aloud: <> !*''# Waka waka bang splat tick tick hash, ^"`$$- Caret quote back-tick dollar dollar dash, !*=@$_ Bang splat equal at dollar under-score, %*<> ~#4 Percent splat waka waka tilde number four, &[]../ Ampersand bracket bracket dot dot slash, |{,,SYSTEM HALTED Vertical-bar curly-bracket comma comma CRASH. Fred Bremmer and Steve Kroese (Calvin College & Seminary of Grand Rapids, MI.) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///