-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
cli tool: reimplement stdin buffering in -F. #1985
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
Conversation
/* Check if file is "-". If so, use a callback to read OUR stdin (to | ||
|
||
/* Mime part callbacks for stdin. */ | ||
static size_t stdin_read(char *buffer, size_t size, size_t nitems, void *arg) |
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.
There's already a file2memory function you should use instead!
} | ||
/* Shrink buffer to spare memory resources. */ | ||
if(sip->size < sip->curpos) | ||
sip->data = realloc(sip->data, (size_t) sip->size); |
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.
Even shrinking can fail so this return code must be checked and bail out if you fail.
Pushed: 665b3e4 |
Yes, but none of my remarks were addressed? And please use 'closes #[num]' in commit messages that close PRs (or "closes [URL]") |
oh, did I remark after it was merged perhaps? I think you need to give us slightly more time to review... |
Yes, I think so: I've just received the mails. Thanks for your review and I'll take your remarks in consideration. I was not expecting it but just wanted to have checks on cross-platforms :-) |
Fixed: 5650905 |
Dummy PR to check new code on APPVeyor/Travis CI