Problem: Cppcheck warnings.
Solution: Use temp variable. Change NUL to NULL. Swap conditions. (Dominique
Pelle)
if (nl == NULL)
{
/* Flush remaining message that is missing a NL. */
- buf = vim_realloc(buf, node->rq_buflen + 1);
- if (buf == NULL)
+ char_u *new_buf;
+
+ new_buf = vim_realloc(buf, node->rq_buflen + 1);
+ if (new_buf == NULL)
+ /* This might fail over and over again, should the message
+ * be dropped? */
return FALSE;
+ buf = new_buf;
node->rq_buffer = buf;
nl = buf + node->rq_buflen++;
*nl = NUL;
#endif
buf[idx++] = c;
buf[idx] = NUL;
- if (end != NUL && STRNCMP(buf, end, idx) == 0)
+ if (end != NULL && STRNCMP(buf, end, idx) == 0)
{
if (end[idx] == NUL)
break; /* Found the end of paste code. */
ptr[i] = toF_leading(ptr[i]);
++i;
- while (canF_Rjoin(ptr[i]) && i < llen)
+ while (i < llen && canF_Rjoin(ptr[i]))
{
ptr[i] = toF_Rjoin(ptr[i]);
if (F_isterm(ptr[i]) || !F_isalpha(ptr[i]))
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 544,
/**/
543,
/**/