Skip to content
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

stdin piping has problem on windows #341

Closed
jeiea opened this issue Jan 7, 2017 · 2 comments
Closed

stdin piping has problem on windows #341

jeiea opened this issue Jan 7, 2017 · 2 comments

Comments

@jeiea
Copy link
Contributor

jeiea commented Jan 7, 2017

From image-pnm.cpp,

bool image_load_pnm(const char *filename, Image& image) {
    FILE *fp = NULL;
    if (!strcmp(filename,"-")) fp = stdin;
    else fp = fopen(filename,"rb");

Default of stdin is text mode on windows, and it regards 1A byte as EOF.
According to related stackoverflow post, setmode can be the solution.
When I discovered this problem, this appeared with crash due to use of array index -1.

@jonsneyers
Copy link
Member

Thanks for the report! Should be fixed now.

@jeiea
Copy link
Contributor Author

jeiea commented Jun 25, 2017

It's not fixed. I've just checked on Win10 RS1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants