-
Notifications
You must be signed in to change notification settings - Fork 106
Add missing new lines #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -258,12 +258,12 @@ public bool VerifyClear(Stream inputStream, Stream outputStream = null) | |||||||||
| { | ||||||||||
| MemoryStream lineOut = new MemoryStream(); | ||||||||||
| byte[] lineSep = LineSeparator; | ||||||||||
| int lookAhead = ReadInputLine(lineOut, armoredInputStream); | ||||||||||
| var lookAhead = ReadInputLine(lineOut, armoredInputStream); | ||||||||||
|
|
||||||||||
| // Read past message to signature and store message in stream | ||||||||||
| if (lookAhead != -1 && armoredInputStream.IsClearText()) | ||||||||||
| { | ||||||||||
| byte[] line = lineOut.ToArray(); | ||||||||||
| var line = lineOut.ToArray(); | ||||||||||
| outStream.Write(line, 0, GetLengthWithoutSeparatorOrTrailingWhitespace(line)); | ||||||||||
| outStream.Write(lineSep, 0, lineSep.Length); | ||||||||||
|
|
||||||||||
|
|
@@ -273,11 +273,14 @@ public bool VerifyClear(Stream inputStream, Stream outputStream = null) | |||||||||
|
|
||||||||||
| line = lineOut.ToArray(); | ||||||||||
| outStream.Write(line, 0, GetLengthWithoutSeparatorOrTrailingWhitespace(line)); | ||||||||||
| // Add missing new line | ||||||||||
| if (lookAhead != 1) | ||||||||||
|
||||||||||
| if (lookAhead != 1) | |
| if (lookAhead != -1) |
Copilot
AI
Feb 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition lookAhead != 1 is incorrect. The value 1 represents ASCII character 1 (SOH - Start of Heading), not the end of stream. Based on the ReadInputLine implementation and consistent usage throughout the codebase, lookAhead returns -1 when the end of stream is reached. This condition should be lookAhead != -1 to add a line separator for all lines except the last one.
| if (lookAhead != 1) | |
| if (lookAhead != -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition
lookAhead != 1is incorrect. The value1represents ASCII character 1 (SOH - Start of Heading), not the end of stream. Based on the ReadInputLine implementation and consistent usage throughout the codebase,lookAheadreturns-1when the end of stream is reached. This condition should belookAhead != -1to add a line separator for all lines except the last one.