Skip to content

Commit b080ea4

Browse files
authored
Fix offset error in StdIn buffering
When the stdin handler returns a string with a newline character, the `GhostscriptStdIO` class incorrectly removes the number of bytes requested from ghostscript rather than the number of bytes processed before the early return. Instead of removing `count` characters from the buffer string, remove only `position` characters.
1 parent f832a32 commit b080ea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Ghostscript.NET/GhostscriptStdIO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private int gs_std_in(IntPtr handle, IntPtr pointer, int count)
144144
}
145145

146146
// remove written data out from the cached input
147-
_input = _input.Remove(0, count);
147+
_input = _input.Remove(0, position);
148148

149149
// return number of bytes written
150150
return position;

0 commit comments

Comments
 (0)