Mercurial > vim
changeset 26829:88a33cf5aeb6 v8.2.3943
patch 8.2.3943: compiler warning from gcc for uninitialized variable
Commit: https://github.com/vim/vim/commit/491669701c72578f273db53e579d8a03a9deac0c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 30 10:51:45 2021 +0000
patch 8.2.3943: compiler warning from gcc for uninitialized variable
Problem: Compiler warning from gcc for uninitialized variable.
Solution: Initialize variable. (closes https://github.com/vim/vim/issues/9429)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 Dec 2021 12:00:03 +0100 |
parents | e05512129055 |
children | 13ecf040b431 |
files | src/diff.c src/version.c |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/diff.c +++ b/src/diff.c @@ -1636,7 +1636,7 @@ diff_read( long off; int i; int notset = TRUE; // block "*dp" not set yet - diffhunk_T *hunk; + diffhunk_T *hunk = NULL; // init to avoid gcc warning enum { DIFF_ED, @@ -1662,10 +1662,7 @@ diff_read( { hunk = ALLOC_ONE(diffhunk_T); if (hunk == NULL) - { - emsg(_("E98: Cannot read diff output")); return; - } } for (;;)