mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
simplegrep: open file in binary mode ("rb")
Otherwise it hangs on binary files (platform MinGW).
This commit is contained in:
parent
e9cfbae68f
commit
373a624bad
@ -77,7 +77,7 @@ static int eventHandler(unsigned int id, unsigned long long from,
|
|||||||
* length with its length. Returns NULL on failure.
|
* length with its length. Returns NULL on failure.
|
||||||
*/
|
*/
|
||||||
static char *readInputData(const char *inputFN, unsigned int *length) {
|
static char *readInputData(const char *inputFN, unsigned int *length) {
|
||||||
FILE *f = fopen(inputFN, "r");
|
FILE *f = fopen(inputFN, "rb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
fprintf(stderr, "ERROR: unable to open file \"%s\": %s\n", inputFN,
|
fprintf(stderr, "ERROR: unable to open file \"%s\": %s\n", inputFN,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user