diff src/if_cscope.c @ 13136:bc735a129ea9 v8.0.1442

patch 8.0.1442: using pointer before it is set commit https://github.com/vim/vim/commit/a172b63ab8661019dba61285a738c8b6b55a33aa Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 30 22:52:06 2018 +0100 patch 8.0.1442: using pointer before it is set Problem: Using pointer before it is set. Solution: Search in whole buffer instead of next token.
author Christian Brabandt <cb@256bit.org>
date Tue, 30 Jan 2018 23:00:07 +0100
parents 161b5fe12b11
children ac42c4b11dbc
line wrap: on
line diff
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -702,7 +702,7 @@ cs_cnt_matches(int idx)
 	 * Accept "\S*cscope: X lines", also matches "mlcscope".
 	 * Bail out for the "Unable to search" error.
 	 */
-	if (strstr((const char *)stok, "Unable to search database") != NULL)
+	if (strstr((const char *)buf, "Unable to search database") != NULL)
 	    break;
 	if ((stok = strtok(buf, (const char *)" ")) == NULL)
 	    continue;