diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-11-22 11:02:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 11:02:24 +0100 |
commit | cd386b2c72eaacd9acac27380ee34db1accad9cb (patch) | |
tree | 15f906032e4091204450ed197da3ad97ddcb5049 /src/nvim/diff.c | |
parent | 5eb5f4948826e9d47685ea9e257409cc3e693614 (diff) | |
parent | 40f3f75867bf03abfd90e0389a38197a00d37af1 (diff) | |
download | rneovim-cd386b2c72eaacd9acac27380ee34db1accad9cb.tar.gz rneovim-cd386b2c72eaacd9acac27380ee34db1accad9cb.tar.bz2 rneovim-cd386b2c72eaacd9acac27380ee34db1accad9cb.zip |
Merge pull request #20151 from dundargoc/refactor/char_u/13
refactor: replace char_u with char 13: remove `STRLEN` part 3
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r-- | src/nvim/diff.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 4b71142c11..121b98d047 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1043,7 +1043,7 @@ static int check_external_diff(diffio_T *diffio) for (;;) { // For normal diff there must be a line that contains // "1c1". For unified diff "@@ -1 +1 @@". - if (vim_fgets((char_u *)linebuf, LBUFLEN, fd)) { + if (vim_fgets(linebuf, LBUFLEN, fd)) { break; } @@ -1218,9 +1218,9 @@ void ex_diffpatch(exarg_T *eap) esc_name = (char *)vim_strsave_shellescape((char_u *)(fullname != NULL ? fullname : eap->arg), true, true); #else - esc_name = vim_strsave_shellescape(eap->arg, true, true); + esc_name = (char *)vim_strsave_shellescape(eap->arg, true, true); #endif - size_t buflen = STRLEN(tmp_orig) + STRLEN(esc_name) + STRLEN(tmp_new) + 16; + size_t buflen = strlen(tmp_orig) + strlen(esc_name) + strlen(tmp_new) + 16; buf = xmalloc(buflen); #ifdef UNIX @@ -1557,7 +1557,7 @@ static bool extract_hunk(FILE *fd, diffhunk_T *hunk, diffstyle_T *diffstyle) { for (;;) { char line[LBUFLEN]; // only need to hold the diff line - if (vim_fgets((char_u *)line, LBUFLEN, fd)) { + if (vim_fgets(line, LBUFLEN, fd)) { return true; // end of file } @@ -1577,9 +1577,9 @@ static bool extract_hunk(FILE *fd, diffhunk_T *hunk, diffstyle_T *diffstyle) } else if ((STRNCMP(line, "@@ ", 3) == 0)) { *diffstyle = DIFF_UNIFIED; } else if ((STRNCMP(line, "--- ", 4) == 0) // -V501 - && (vim_fgets((char_u *)line, LBUFLEN, fd) == 0) // -V501 + && (vim_fgets(line, LBUFLEN, fd) == 0) // -V501 && (STRNCMP(line, "+++ ", 4) == 0) - && (vim_fgets((char_u *)line, LBUFLEN, fd) == 0) // -V501 + && (vim_fgets(line, LBUFLEN, fd) == 0) // -V501 && (STRNCMP(line, "@@ ", 3) == 0)) { *diffstyle = DIFF_UNIFIED; } else { |