From b7b3bc0af0ab46dfd68bce5de75766c51fc1e033 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 19 Sep 2018 16:36:01 +0200 Subject: [PATCH] Fix problem with \? at end of input format when no more input is available. Used to work. Works again (but was not really intended) --- src/StreamCore.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/StreamCore.cc b/src/StreamCore.cc index 6547158..b50ba2d 100644 --- a/src/StreamCore.cc +++ b/src/StreamCore.cc @@ -1315,12 +1315,12 @@ normal_format: break; } case StreamProtocolParser::skip: - // ignore next input byte - consumedInput++; + // ignore next input byte (if exists) + if (consumedInput < inputLine.length()) consumedInput++; break; case StreamProtocolParser::whitespace: // any number of whitespace (including 0) - while (isspace(inputLine[consumedInput])) consumedInput++; + while (consumedInput < inputLine.length() && isspace(inputLine[consumedInput])) consumedInput++; break; case esc: // escaped literal byte