aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/fs.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-02-04 05:57:15 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-02-04 11:07:50 +0100
commitea449b16b95df59b09862961694e28d1d5c8144d (patch)
tree0cdbe82a9dbcbaae159f7095ae78c6a51f6a3837 /src/nvim/os/fs.c
parent67fbbdb1b5eb6e48c7c533042abba9e409833ca6 (diff)
downloadrneovim-ea449b16b95df59b09862961694e28d1d5c8144d.tar.gz
rneovim-ea449b16b95df59b09862961694e28d1d5c8144d.tar.bz2
rneovim-ea449b16b95df59b09862961694e28d1d5c8144d.zip
refactor: fix warnings
Diffstat (limited to 'src/nvim/os/fs.c')
-rw-r--r--src/nvim/os/fs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 7266e54b58..097c672887 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -424,11 +424,11 @@ ptrdiff_t os_read(const int fd, bool *ret_eof, char *const ret_buf,
size_t read_bytes = 0;
bool did_try_to_free = false;
while (read_bytes != size) {
+ assert(size >= read_bytes);
const ptrdiff_t cur_read_bytes = read(fd, ret_buf + read_bytes,
size - read_bytes);
if (cur_read_bytes > 0) {
read_bytes += (size_t)cur_read_bytes;
- assert(read_bytes <= size);
}
if (cur_read_bytes < 0) {
const int error = os_translate_sys_error(errno);
@@ -527,6 +527,7 @@ ptrdiff_t os_write(const int fd, const char *const buf, const size_t size)
}
size_t written_bytes = 0;
while (written_bytes != size) {
+ assert(size >= written_bytes);
const ptrdiff_t cur_written_bytes = write(fd, buf + written_bytes,
size - written_bytes);
if (cur_written_bytes > 0) {
@@ -949,12 +950,12 @@ bool os_fileid_equal_fileinfo(const FileID *file_id,
/// When "fname" is the name of a shortcut (*.lnk) resolve the file it points
/// to and return that name in allocated memory.
/// Otherwise NULL is returned.
-char_u * os_resolve_shortcut(char_u *fname)
+char *os_resolve_shortcut(char_u *fname)
{
HRESULT hr;
IPersistFile *ppf = NULL;
OLECHAR wsz[MAX_PATH];
- char_u *rfname = NULL;
+ char *rfname = NULL;
int len;
IShellLinkW *pslw = NULL;
WIN32_FIND_DATAW ffdw;