summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-28 23:10:07 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-28 23:10:07 +0100
commit83162468b3c8722fffea033d3de144cd4191472a (patch)
tree65a4d3832fe5b02094750192c36127a2cb0c0764 /src
parentb8b6511fc1f8422a17778d710ed11538174a7f33 (diff)
patch 7.4.1194v7.4.1194
Problem: Compiler warning for not using return value of fwrite(). Solution: Return OK/FAIL. (Charles Campbell)
Diffstat (limited to 'src')
-rw-r--r--src/channel.c11
-rw-r--r--src/proto/channel.pro2
-rw-r--r--src/version.c2
3 files changed, 10 insertions, 5 deletions
diff --git a/src/channel.c b/src/channel.c
index c18f25e263..def6833136 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -560,8 +560,9 @@ channel_close(int idx)
/*
* Store "buf[len]" on channel "idx".
+ * Returns OK or FAIL.
*/
- void
+ int
channel_save(int idx, char_u *buf, int len)
{
queue_T *node;
@@ -569,12 +570,12 @@ channel_save(int idx, char_u *buf, int len)
node = (queue_T *)alloc(sizeof(queue_T));
if (node == NULL)
- return; /* out of memory */
+ return FAIL; /* out of memory */
node->buffer = alloc(len + 1);
if (node->buffer == NULL)
{
vim_free(node);
- return; /* out of memory */
+ return FAIL; /* out of memory */
}
mch_memmove(node->buffer, buf, (size_t)len);
node->buffer[len] = NUL;
@@ -594,9 +595,11 @@ channel_save(int idx, char_u *buf, int len)
if (debugfd != NULL)
{
fprintf(debugfd, "RECV on %d: ", idx);
- fwrite(buf, len, 1, debugfd);
+ if (fwrite(buf, len, 1, debugfd) != 1)
+ return FAIL;
fprintf(debugfd, "\n");
}
+ return OK;
}
/*
diff --git a/src/proto/channel.pro b/src/proto/channel.pro
index 110bb1da31..2d46a4963f 100644
--- a/src/proto/channel.pro
+++ b/src/proto/channel.pro
@@ -8,7 +8,7 @@ void channel_will_block(int idx);
int channel_decode_json(char_u *msg, typval_T *tv);
int channel_is_open(int idx);
void channel_close(int idx);
-void channel_save(int idx, char_u *buf, int len);
+int channel_save(int idx, char_u *buf, int len);
char_u *channel_peek(int idx);
char_u *channel_get(int idx);
int channel_collapse(int idx);
diff --git a/src/version.c b/src/version.c
index 98c499a925..c246ed4bcb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1194,
+/**/
1193,
/**/
1192,