There is a fairly large binary file (approx. 1mb), it is transmitted over the network to write to the file on the receiving computer (under windows). But when you start it, just part of the file from Explorer (exactly the end of the file) is lost. When running from cmd, everything works as it should.
snippet code:
//s - сокет int n; int l = 1195520; char b[l]; puts("Getting..."); n = recv(s, b, l, 0); if(n < 0) return 1; puts("Got file"); n = send(s, "got the file!\n", 14, 0); if(n < 0) return 1; FILE * f; f = fopen("file1", "wb"); fwrite(&b, sizeof(b), 1, f); fclose(f); close(s); puts("Wrote");