To: vim_dev@googlegroups.com Subject: Patch 8.2.4544 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4544 Problem: Coverity warnings for not using returned value. Solution: Assign to vim_ignored. Files: src/tag.c *** ../vim-8.2.4543/src/tag.c 2022-03-11 12:05:15.495608365 +0000 --- src/tag.c 2022-03-11 14:52:27.189169642 +0000 *************** *** 2053,2059 **** { // Adjust the search file offset to the correct position sinfo_p->curr_offset_used = sinfo_p->curr_offset; ! vim_fseek(st->fp, sinfo_p->curr_offset, SEEK_SET); eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp); if (!eof && sinfo_p->curr_offset != 0) { --- 2053,2059 ---- { // Adjust the search file offset to the correct position sinfo_p->curr_offset_used = sinfo_p->curr_offset; ! vim_ignored = vim_fseek(st->fp, sinfo_p->curr_offset, SEEK_SET); eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp); if (!eof && sinfo_p->curr_offset != 0) { *************** *** 2061,2067 **** if (sinfo_p->curr_offset == sinfo_p->high_offset) { // oops, gone a bit too far; try from low offset ! vim_fseek(st->fp, sinfo_p->low_offset, SEEK_SET); sinfo_p->curr_offset = sinfo_p->low_offset; } eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp); --- 2061,2067 ---- if (sinfo_p->curr_offset == sinfo_p->high_offset) { // oops, gone a bit too far; try from low offset ! vim_ignored = vim_fseek(st->fp, sinfo_p->low_offset, SEEK_SET); sinfo_p->curr_offset = sinfo_p->low_offset; } eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp); *************** *** 2222,2228 **** // not portable). Don't use lseek(), it doesn't work // properly on MacOS Catalina. filesize = vim_ftell(st->fp); ! vim_fseek(st->fp, 0L, SEEK_SET); // Calculate the first read offset in the file. Start // the search in the middle of the file. --- 2222,2228 ---- // not portable). Don't use lseek(), it doesn't work // properly on MacOS Catalina. filesize = vim_ftell(st->fp); ! vim_ignored = vim_fseek(st->fp, 0L, SEEK_SET); // Calculate the first read offset in the file. Start // the search in the middle of the file. *************** *** 2852,2858 **** if (st->state == TS_STEP_FORWARD) // Seek to the same position to read the same line again ! vim_fseek(st->fp, search_info.curr_offset, SEEK_SET); // this will try the same thing again, make sure the offset is // different search_info.curr_offset = 0; --- 2852,2859 ---- if (st->state == TS_STEP_FORWARD) // Seek to the same position to read the same line again ! vim_ignored = vim_fseek(st->fp, search_info.curr_offset, ! SEEK_SET); // this will try the same thing again, make sure the offset is // different search_info.curr_offset = 0; *************** *** 2944,2951 **** findtags_get_all_tags(st, &margs, buf_ffname); if (st->fp != NULL) fclose(st->fp); ! st->fp = NULL; #ifdef FEAT_EMACS_TAGS emacs_tags_incstack_free(); #endif --- 2945,2954 ---- findtags_get_all_tags(st, &margs, buf_ffname); if (st->fp != NULL) + { fclose(st->fp); ! st->fp = NULL; ! } #ifdef FEAT_EMACS_TAGS emacs_tags_incstack_free(); #endif *** ../vim-8.2.4543/src/version.c 2022-03-11 12:05:15.495608365 +0000 --- src/version.c 2022-03-11 14:53:05.005037761 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4544, /**/ -- hundred-and-one symptoms of being an internet addict: 230. You spend your Friday nights typing away at your keyboard /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///