[Bug c/97215] Possible fread() malfunction of GCC 7.3.0 (Windows)

sanmayce at sanmayce dot com gcc-bugzilla@gcc.gnu.org
Sun Sep 27 02:36:55 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97215

--- Comment #4 from Georgi <sanmayce at sanmayce dot com> ---
(In reply to Andrew Pinski from comment #2)
> You need b if you don't want \r\n to be turned into just \n.

At 11,945th line I use:

```
        if ((fp = fopen(argv[1], "rb")) == NULL) {
                printf("Nakamichi: Can't open '%s' file.\n", argv[1]);
exit(13);
        }
```

As far as I investigated, the problem is that fread() reads less (around 860
bytes) than specified, after decompression I see those bytes being ASCII 000?!


More information about the Gcc-bugs mailing list