summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-30 10:51:45 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-30 10:51:45 +0000
commit491669701c72578f273db53e579d8a03a9deac0c (patch)
tree3e3dd9f83004d9b1747b7a863f0052eb09d84ca3 /src/diff.c
parent8e7cc6b920ddea37deaa5e6b7b3bdfff2222d137 (diff)
patch 8.2.3943: compiler warning from gcc for uninitialized variablev8.2.3943
Problem: Compiler warning from gcc for uninitialized variable. Solution: Initialize variable. (closes #9429)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/diff.c b/src/diff.c
index d42233889c..a3bb9c405f 100644
--- 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 (;;)