summaryrefslogtreecommitdiff
authorAaro Koskinen <aaro.koskinen@iki.fi>2016-11-21 22:19:50 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2016-11-24 10:38:56 (GMT)
commit2eff59667d3c590f27ee39cd0969b2221af739a0 (patch)
treeeffde9a154e1ba62f5e72bc5ec9fed822dc4ee90
parent5bbee27c0fcafe60f43a294afa1352b5ddcab6f3 (diff)
downloadbusybox-2eff59667d3c590f27ee39cd0969b2221af739a0.zip
busybox-2eff59667d3c590f27ee39cd0969b2221af739a0.tar.gz
busybox-2eff59667d3c590f27ee39cd0969b2221af739a0.tar.bz2
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>
Diffstat
-rw-r--r--editors/patch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/patch.c b/editors/patch.c
index 988021d..4ee9339 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -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;