forked from aniani/vim
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)
This commit is contained in:
@@ -42,7 +42,11 @@ typedef enum {
|
|||||||
} WtWait;
|
} WtWait;
|
||||||
|
|
||||||
|
|
||||||
void nbdbg(char *, ...);
|
void nbdbg(char *, ...)
|
||||||
|
#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
||||||
|
__attribute__((format(printf, 1, 2)))
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
void nbdebug_wait(u_int wait_flags, char *wait_var, u_int wait_secs);
|
void nbdebug_wait(u_int wait_flags, char *wait_var, u_int wait_secs);
|
||||||
void nbdebug_log_init(char *log_var, char *level_var);
|
void nbdebug_log_init(char *log_var, char *level_var);
|
||||||
|
@@ -934,7 +934,7 @@ nb_partialremove(linenr_T lnum, colnr_T first, colnr_T last)
|
|||||||
{
|
{
|
||||||
mch_memmove(newtext, oldtext, first);
|
mch_memmove(newtext, oldtext, first);
|
||||||
STRMOVE(newtext + first, oldtext + lastbyte + 1);
|
STRMOVE(newtext + first, oldtext + lastbyte + 1);
|
||||||
nbdebug((" NEW LINE %d: %s\n", lnum, newtext));
|
nbdebug((" NEW LINE %ld: %s\n", lnum, newtext));
|
||||||
ml_replace(lnum, newtext, FALSE);
|
ml_replace(lnum, newtext, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1166,7 +1166,7 @@ nb_do_cmd(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
first = *pos;
|
first = *pos;
|
||||||
nbdebug((" FIRST POS: line %d, col %d\n",
|
nbdebug((" FIRST POS: line %ld, col %d\n",
|
||||||
first.lnum, first.col));
|
first.lnum, first.col));
|
||||||
pos = off2pos(buf->bufp, off+count-1);
|
pos = off2pos(buf->bufp, off+count-1);
|
||||||
if (!pos)
|
if (!pos)
|
||||||
@@ -1178,7 +1178,7 @@ nb_do_cmd(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
last = *pos;
|
last = *pos;
|
||||||
nbdebug((" LAST POS: line %d, col %d\n",
|
nbdebug((" LAST POS: line %ld, col %d\n",
|
||||||
last.lnum, last.col));
|
last.lnum, last.col));
|
||||||
del_from_lnum = first.lnum;
|
del_from_lnum = first.lnum;
|
||||||
del_to_lnum = last.lnum;
|
del_to_lnum = last.lnum;
|
||||||
@@ -1264,7 +1264,7 @@ nb_do_cmd(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nbdebug((" Deleting lines %d through %d\n",
|
nbdebug((" Deleting lines %ld through %ld\n",
|
||||||
del_from_lnum, del_to_lnum));
|
del_from_lnum, del_to_lnum));
|
||||||
curwin->w_cursor.lnum = del_from_lnum;
|
curwin->w_cursor.lnum = del_from_lnum;
|
||||||
curwin->w_cursor.col = 0;
|
curwin->w_cursor.col = 0;
|
||||||
@@ -1540,7 +1540,7 @@ nb_do_cmd(
|
|||||||
{
|
{
|
||||||
if (!buf->bufp->b_netbeans_file)
|
if (!buf->bufp->b_netbeans_file)
|
||||||
{
|
{
|
||||||
nbdebug(("E658: NetBeans connection lost for buffer %ld\n", buf->bufp->b_fnum));
|
nbdebug(("E658: NetBeans connection lost for buffer %d\n", buf->bufp->b_fnum));
|
||||||
semsg(_("E658: NetBeans connection lost for buffer %d"),
|
semsg(_("E658: NetBeans connection lost for buffer %d"),
|
||||||
buf->bufp->b_fnum);
|
buf->bufp->b_fnum);
|
||||||
}
|
}
|
||||||
|
@@ -779,6 +779,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
944,
|
||||||
/**/
|
/**/
|
||||||
943,
|
943,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user