comparison src/window.c @ 15490:98c35d312987 v8.1.0753

patch 8.1.0753: printf format not checked for semsg() commit https://github.com/vim/vim/commit/b5443cc46dd1485d6c785dd8c65a2c07bd5a17f3 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 15 20:19:40 2019 +0100 patch 8.1.0753: printf format not checked for semsg() Problem: printf format not checked for semsg(). Solution: Add GNUC attribute and fix reported problems. (Dominique Pelle, closes #3805)
author Bram Moolenaar <Bram@vim.org>
date Tue, 15 Jan 2019 20:30:07 +0100
parents 55ccc2d353bd
children dd725a8ab112
comparison
equal deleted inserted replaced
15489:3bbefd5c9d0d 15490:98c35d312987
6780 6780
6781 if (*grp == NUL || (pat != NULL && *pat == NUL)) 6781 if (*grp == NUL || (pat != NULL && *pat == NUL))
6782 return -1; 6782 return -1;
6783 if (id < -1 || id == 0) 6783 if (id < -1 || id == 0)
6784 { 6784 {
6785 semsg(_("E799: Invalid ID: %ld (must be greater than or equal to 1)"), id); 6785 semsg(_("E799: Invalid ID: %d (must be greater than or equal to 1)"), id);
6786 return -1; 6786 return -1;
6787 } 6787 }
6788 if (id != -1) 6788 if (id != -1)
6789 { 6789 {
6790 cur = wp->w_match_head; 6790 cur = wp->w_match_head;
6791 while (cur != NULL) 6791 while (cur != NULL)
6792 { 6792 {
6793 if (cur->id == id) 6793 if (cur->id == id)
6794 { 6794 {
6795 semsg(_("E801: ID already taken: %ld"), id); 6795 semsg(_("E801: ID already taken: %d"), id);
6796 return -1; 6796 return -1;
6797 } 6797 }
6798 cur = cur->next; 6798 cur = cur->next;
6799 } 6799 }
6800 } 6800 }
6967 int rtype = SOME_VALID; 6967 int rtype = SOME_VALID;
6968 6968
6969 if (id < 1) 6969 if (id < 1)
6970 { 6970 {
6971 if (perr == TRUE) 6971 if (perr == TRUE)
6972 semsg(_("E802: Invalid ID: %ld (must be greater than or equal to 1)"), 6972 semsg(_("E802: Invalid ID: %d (must be greater than or equal to 1)"),
6973 id); 6973 id);
6974 return -1; 6974 return -1;
6975 } 6975 }
6976 while (cur != NULL && cur->id != id) 6976 while (cur != NULL && cur->id != id)
6977 { 6977 {
6979 cur = cur->next; 6979 cur = cur->next;
6980 } 6980 }
6981 if (cur == NULL) 6981 if (cur == NULL)
6982 { 6982 {
6983 if (perr == TRUE) 6983 if (perr == TRUE)
6984 semsg(_("E803: ID not found: %ld"), id); 6984 semsg(_("E803: ID not found: %d"), id);
6985 return -1; 6985 return -1;
6986 } 6986 }
6987 if (cur == prev) 6987 if (cur == prev)
6988 wp->w_match_head = cur->next; 6988 wp->w_match_head = cur->next;
6989 else 6989 else