patch: fix debug log failure

If we reach the end of plist it means the input has still data while we
are expecting EOF. Fix the log to avoid a crash.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Aaro Koskinen 2016-11-22 00:19:50 +02:00 committed by Denys Vlasenko
parent 5bbee27c0f
commit 2eff59667d

View File

@ -295,7 +295,7 @@ static int apply_one_hunk(void)
// recheck remaining buffered data for a new match.
if (PATCH_DEBUG)
fdprintf(2, "NOT: %s\n", plist->data);
fdprintf(2, "NOT: %s\n", plist ? plist->data : "EOF");
TT.state = 3;
check = buf;