diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2014-06-13 18:09:08 -0400 | 
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-13 18:09:08 -0400 | 
| commit | 8bbeb4b480a72d0099a18c4d8200313600045231 (patch) | |
| tree | cf153eceb121aef15e50631282e9171a24b74406 /src/nvim/quickfix.c | |
| parent | 5b3b3fd3ed4372866730ae857e8c09d6e5d1167d (diff) | |
| parent | d430f039d1255eaab55470b5613d83c24d030a64 (diff) | |
| download | rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.tar.gz rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.tar.bz2 rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.zip | |
Merge #743 'Replace vim_strncpy with strlcpy'
Diffstat (limited to 'src/nvim/quickfix.c')
| -rw-r--r-- | src/nvim/quickfix.c | 12 | 
1 files changed, 6 insertions, 6 deletions
| diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index bfac62de3d..0e40b8eb3e 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -484,9 +484,9 @@ qf_init_ext (              len = (int)STRLEN(p_str);            if (len > CMDBUFFSIZE - 2) -            vim_strncpy(IObuff, p_str, CMDBUFFSIZE - 2); +            STRLCPY(IObuff, p_str, CMDBUFFSIZE - 1);            else -            vim_strncpy(IObuff, p_str, len); +            STRLCPY(IObuff, p_str, len + 1);            p_str += len;          } else if (tv->v_type == VAR_LIST) { @@ -501,7 +501,7 @@ qf_init_ext (            if (len > CMDBUFFSIZE - 2)              len = CMDBUFFSIZE - 2; -          vim_strncpy(IObuff, p_li->li_tv.vval.v_string, len); +          STRLCPY(IObuff, p_li->li_tv.vval.v_string, len + 1);            p_li = p_li->li_next;                 /* next item */          } @@ -509,8 +509,8 @@ qf_init_ext (          /* Get the next line from the supplied buffer */          if (buflnum > lnumlast)            break; -        vim_strncpy(IObuff, ml_get_buf(buf, buflnum++, FALSE), -            CMDBUFFSIZE - 2); +        STRLCPY(IObuff, ml_get_buf(buf, buflnum++, FALSE), +            CMDBUFFSIZE - 1);        }      } else if (fgets((char *)IObuff, CMDBUFFSIZE - 2, fd) == NULL)        break; @@ -609,7 +609,7 @@ restofline:            if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)              continue;            len = (int)(regmatch.endp[i] - regmatch.startp[i]); -          vim_strncpy(errmsg, regmatch.startp[i], len); +          STRLCPY(errmsg, regmatch.startp[i], len + 1);          }          if ((i = (int)fmt_ptr->addr[6]) > 0) {                  /* %r */            if (regmatch.startp[i] == NULL) | 
