diff src/if_xcmdsrv.c @ 7009:286fd54c7ae3 v7.4.822

patch 7.4.822 Problem: More problems reported by coverity. Solution: Avoid the warnings. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Aug 2015 19:14:00 +0200
parents 928e7cef8836
children fa95595fbc52
line wrap: on
line diff
--- 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;
 	    }
 	}