Mercurial > vim
comparison src/netbeans.c @ 15874:c7ba5fed403c v8.1.0944
patch 8.1.0944: format of nbdbg() arguments is not checked
commit https://github.com/vim/vim/commit/c85c8fcb9fad565da78e01248c12f662f6bc04c8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 17 19:12:21 2019 +0100
patch 8.1.0944: format of nbdbg() arguments is not checked
Problem: Format of nbdbg() arguments is not checked.
Solution: Add format attribute. Fix reported problems. (Dominique Pelle,
closes #3992)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Feb 2019 19:15:05 +0100 |
parents | 7fad90423bd2 |
children | cd5c83115ec6 |
comparison
equal
deleted
inserted
replaced
15873:bc3ab9cd09d2 | 15874:c7ba5fed403c |
---|---|
932 newtext = alloc(oldlen - (int)(lastbyte - first)); | 932 newtext = alloc(oldlen - (int)(lastbyte - first)); |
933 if (newtext != NULL) | 933 if (newtext != NULL) |
934 { | 934 { |
935 mch_memmove(newtext, oldtext, first); | 935 mch_memmove(newtext, oldtext, first); |
936 STRMOVE(newtext + first, oldtext + lastbyte + 1); | 936 STRMOVE(newtext + first, oldtext + lastbyte + 1); |
937 nbdebug((" NEW LINE %d: %s\n", lnum, newtext)); | 937 nbdebug((" NEW LINE %ld: %s\n", lnum, newtext)); |
938 ml_replace(lnum, newtext, FALSE); | 938 ml_replace(lnum, newtext, FALSE); |
939 } | 939 } |
940 } | 940 } |
941 | 941 |
942 /* | 942 /* |
1164 netbeansFireChanges = oldFire; | 1164 netbeansFireChanges = oldFire; |
1165 netbeansSuppressNoLines = oldSuppress; | 1165 netbeansSuppressNoLines = oldSuppress; |
1166 return FAIL; | 1166 return FAIL; |
1167 } | 1167 } |
1168 first = *pos; | 1168 first = *pos; |
1169 nbdebug((" FIRST POS: line %d, col %d\n", | 1169 nbdebug((" FIRST POS: line %ld, col %d\n", |
1170 first.lnum, first.col)); | 1170 first.lnum, first.col)); |
1171 pos = off2pos(buf->bufp, off+count-1); | 1171 pos = off2pos(buf->bufp, off+count-1); |
1172 if (!pos) | 1172 if (!pos) |
1173 { | 1173 { |
1174 nbdebug((" !bad count\n")); | 1174 nbdebug((" !bad count\n")); |
1176 netbeansFireChanges = oldFire; | 1176 netbeansFireChanges = oldFire; |
1177 netbeansSuppressNoLines = oldSuppress; | 1177 netbeansSuppressNoLines = oldSuppress; |
1178 return FAIL; | 1178 return FAIL; |
1179 } | 1179 } |
1180 last = *pos; | 1180 last = *pos; |
1181 nbdebug((" LAST POS: line %d, col %d\n", | 1181 nbdebug((" LAST POS: line %ld, col %d\n", |
1182 last.lnum, last.col)); | 1182 last.lnum, last.col)); |
1183 del_from_lnum = first.lnum; | 1183 del_from_lnum = first.lnum; |
1184 del_to_lnum = last.lnum; | 1184 del_to_lnum = last.lnum; |
1185 do_update = 1; | 1185 do_update = 1; |
1186 | 1186 |
1262 { | 1262 { |
1263 nbdebug((" No sign on line %d\n", i)); | 1263 nbdebug((" No sign on line %d\n", i)); |
1264 } | 1264 } |
1265 } | 1265 } |
1266 | 1266 |
1267 nbdebug((" Deleting lines %d through %d\n", | 1267 nbdebug((" Deleting lines %ld through %ld\n", |
1268 del_from_lnum, del_to_lnum)); | 1268 del_from_lnum, del_to_lnum)); |
1269 curwin->w_cursor.lnum = del_from_lnum; | 1269 curwin->w_cursor.lnum = del_from_lnum; |
1270 curwin->w_cursor.col = 0; | 1270 curwin->w_cursor.col = 0; |
1271 del_lines(del_to_lnum - del_from_lnum + 1, FALSE); | 1271 del_lines(del_to_lnum - del_from_lnum + 1, FALSE); |
1272 } | 1272 } |
1538 buf->fireChanges = 0; | 1538 buf->fireChanges = 0; |
1539 if (buf->bufp != NULL && buf->bufp->b_was_netbeans_file) | 1539 if (buf->bufp != NULL && buf->bufp->b_was_netbeans_file) |
1540 { | 1540 { |
1541 if (!buf->bufp->b_netbeans_file) | 1541 if (!buf->bufp->b_netbeans_file) |
1542 { | 1542 { |
1543 nbdebug(("E658: NetBeans connection lost for buffer %ld\n", buf->bufp->b_fnum)); | 1543 nbdebug(("E658: NetBeans connection lost for buffer %d\n", buf->bufp->b_fnum)); |
1544 semsg(_("E658: NetBeans connection lost for buffer %d"), | 1544 semsg(_("E658: NetBeans connection lost for buffer %d"), |
1545 buf->bufp->b_fnum); | 1545 buf->bufp->b_fnum); |
1546 } | 1546 } |
1547 else | 1547 else |
1548 { | 1548 { |