diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-08-11 19:14:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-08-11 19:14:00 +0200 |
commit | cde885473099296c4837de261833f48b24caf87c (patch) | |
tree | 7864f4147f9c3b57a77b649c7d14e8ad31cafa6c /src/if_xcmdsrv.c | |
parent | bd8539aac385d265d41da2e8ab59d7b9c3694557 (diff) | |
download | vim-git-cde885473099296c4837de261833f48b24caf87c.tar.gz |
patch 7.4.822v7.4.822
Problem: More problems reported by coverity.
Solution: Avoid the warnings. (Christian Brabandt)
Diffstat (limited to 'src/if_xcmdsrv.c')
-rw-r--r-- | src/if_xcmdsrv.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c index 44526d70b..d8c64ad4b 100644 --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -1265,12 +1265,12 @@ serverEventProc(dpy, eventPtr) /* Initialize the result property. */ ga_init2(&reply, 1, 100); #ifdef FEAT_MBYTE - ga_grow(&reply, 50 + STRLEN(p_enc)); + (void)ga_grow(&reply, 50 + STRLEN(p_enc)); sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ", 0, 0, p_enc, 0, serial, 0); reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial); #else - ga_grow(&reply, 50); + (void)ga_grow(&reply, 50); sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0); reply.ga_len = 10 + STRLEN(serial); @@ -1351,15 +1351,10 @@ serverEventProc(dpy, eventPtr) continue; pcPtr->code = code; - if (res != NULL) - { - res = serverConvert(enc, res, &tofree); - if (tofree == NULL) - res = vim_strsave(res); - pcPtr->result = res; - } - else - pcPtr->result = vim_strsave((char_u *)""); + res = serverConvert(enc, res, &tofree); + if (tofree == NULL) + res = vim_strsave(res); + pcPtr->result = res; break; } } |