diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-04-27 09:25:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 09:25:02 +0200 |
commit | 53f11dcfc7139fe6c8a6b114db4bfec5d91005a9 (patch) | |
tree | e9bfbaf10fc6681bbbcba0a0eabdce8a6f6840b5 /src/nvim/fileio.c | |
parent | 009ccfe170ada2c78ca7feabda567a7e901fb30b (diff) | |
parent | 4ce8521ee4a72e050bd187c2986708c5f98c7442 (diff) | |
download | rneovim-53f11dcfc7139fe6c8a6b114db4bfec5d91005a9.tar.gz rneovim-53f11dcfc7139fe6c8a6b114db4bfec5d91005a9.tar.bz2 rneovim-53f11dcfc7139fe6c8a6b114db4bfec5d91005a9.zip |
Merge #8218 'Fix errors reported by PVS'
closes #4983
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index d96f5412ec..efeee1ba2b 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -298,8 +298,7 @@ readfile ( off_T filesize = 0; int skip_read = false; context_sha256_T sha_ctx; - int read_undo_file = FALSE; - int split = 0; /* number of split lines */ + int read_undo_file = false; linenr_T linecnt; int error = FALSE; /* errors encountered */ int ff_error = EOL_UNKNOWN; /* file format with errors */ @@ -1029,8 +1028,8 @@ retry: size = size / ICONV_MULT; /* worst case */ if (conv_restlen > 0) { - /* Insert unconverted bytes from previous line. */ - memmove(ptr, conv_rest, conv_restlen); + // Insert unconverted bytes from previous line. + memmove(ptr, conv_rest, conv_restlen); // -V614 ptr += conv_restlen; size -= conv_restlen; } @@ -1842,10 +1841,6 @@ failed: STRCAT(IObuff, _("[CR missing]")); c = TRUE; } - if (split) { - STRCAT(IObuff, _("[long lines split]")); - c = TRUE; - } if (notconverted) { STRCAT(IObuff, _("[NOT converted]")); c = TRUE; @@ -3352,9 +3347,9 @@ restore_backup: *s++ = NL; } } - if (++len == bufsize && end) { + if (++len == bufsize) { if (buf_write_bytes(&write_info) == FAIL) { - end = 0; /* write error: break loop */ + end = 0; // Write error: break loop. break; } nchars += bufsize; @@ -3363,7 +3358,7 @@ restore_backup: os_breakcheck(); if (got_int) { - end = 0; /* Interrupted, break loop */ + end = 0; // Interrupted, break loop. break; } } |