-
Notifications
You must be signed in to change notification settings - Fork 92
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
Reading from a pipe is messed up #14
Comments
Thanks for reporting the bug @matthijskooijman If you are unable to do it, I will of course patch it. |
Sorry, I really can't spare the time right now. |
arun11299
added a commit
that referenced
this issue
Apr 16, 2018
No problem. I have pushed the fix. Thanks! |
Looks good, thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried reading output from stderr from a process, and it gets all messed up. It seems the length of the buffer returned is correct, but only the first couple of hundred bytes are filled, the rest are zeroes.
Looking at the code, it seems that
read_atmost_n
does not handle partial reads correctly. Changing this line to the following seems to fix this.On a related note, I suspect that if
read_all
resizes the buffer and causes arealloc
, then thebuffer
variable might become invalid.The text was updated successfully, but these errors were encountered: