The driver seeks backwards on the input stream; this is
not possible on pipes, and causes a cascade of problems
later on, as it is off by one character. In
particular, various reads fail, eventually leading to a
segv. I'm a little confused how things worked in the
first place, as the x125_cmyk_print.sh script always
passes input via a pipe.
I'm also confused as to why the last character in the
file is effectively ignored (by reading it and then
checking for EOF), but since things seem to print,
maybe that's ok.
I've attached a patch against 0.2.3 which does the
following:
- uses ungetc rather than fseek to handle putting the
character back on the stream
- checks the return of all of the reads on the input.
ignoring these lead to the segv.
- more gracefully handles exiting the program when
the device is unable to be opened
Thanks a lot for writing the driver!