Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
7008:7ce1f4e998bb | 7009:286fd54c7ae3 |
---|---|
1263 garray_T reply; | 1263 garray_T reply; |
1264 | 1264 |
1265 /* Initialize the result property. */ | 1265 /* Initialize the result property. */ |
1266 ga_init2(&reply, 1, 100); | 1266 ga_init2(&reply, 1, 100); |
1267 #ifdef FEAT_MBYTE | 1267 #ifdef FEAT_MBYTE |
1268 ga_grow(&reply, 50 + STRLEN(p_enc)); | 1268 (void)ga_grow(&reply, 50 + STRLEN(p_enc)); |
1269 sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ", | 1269 sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ", |
1270 0, 0, p_enc, 0, serial, 0); | 1270 0, 0, p_enc, 0, serial, 0); |
1271 reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial); | 1271 reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial); |
1272 #else | 1272 #else |
1273 ga_grow(&reply, 50); | 1273 (void)ga_grow(&reply, 50); |
1274 sprintf(reply.ga_data, "%cr%c-s %s%c-r ", | 1274 sprintf(reply.ga_data, "%cr%c-s %s%c-r ", |
1275 0, 0, serial, 0); | 1275 0, 0, serial, 0); |
1276 reply.ga_len = 10 + STRLEN(serial); | 1276 reply.ga_len = 10 + STRLEN(serial); |
1277 #endif | 1277 #endif |
1278 | 1278 |
1349 { | 1349 { |
1350 if (serial != pcPtr->serial || pcPtr->result != NULL) | 1350 if (serial != pcPtr->serial || pcPtr->result != NULL) |
1351 continue; | 1351 continue; |
1352 | 1352 |
1353 pcPtr->code = code; | 1353 pcPtr->code = code; |
1354 if (res != NULL) | 1354 res = serverConvert(enc, res, &tofree); |
1355 { | 1355 if (tofree == NULL) |
1356 res = serverConvert(enc, res, &tofree); | 1356 res = vim_strsave(res); |
1357 if (tofree == NULL) | 1357 pcPtr->result = res; |
1358 res = vim_strsave(res); | |
1359 pcPtr->result = res; | |
1360 } | |
1361 else | |
1362 pcPtr->result = vim_strsave((char_u *)""); | |
1363 break; | 1358 break; |
1364 } | 1359 } |
1365 } | 1360 } |
1366 else if (*p == 'n' && p[1] == 0) | 1361 else if (*p == 'n' && p[1] == 0) |
1367 { | 1362 { |