Problem with a for() loop.
Currently, in Linux, the for() loop I've written gives me no problems. However, when Windows users try working with it, the data get offset after so many times going around and they get thrown into an infinite loop. I'll show the for() loop, the data that a Windows user gets, and the data that I get from it.
The for() loop:
Code:
for( ; ; )
{
byte1=fgetc(portfrom);
byte2=fgetc(portfrom);
byte3=fgetc(portfrom);
byte4=fgetc(portfrom);
byte5=fgetc(portfrom);
byte6=fgetc(portfrom);
byte7=fgetc(portfrom);
byte8=fgetc(portfrom);
fputc(byte1,displaylist);
fputc(byte2,displaylist);
fputc(byte3,displaylist);
fputc(byte4,displaylist);
fputc(byte5,displaylist);
fputc(byte6,displaylist);
fputc(byte7,displaylist);
fputc(byte8,displaylist);
if(byte1==0xDF && byte2==0x00 && byte3==0x00 && byte4==0x00 && byte5==0x00 && byte6==0x00 && byte7==0x00 && byte8==0x00) { break; }
}
Windows User Data (this is cut off; the FFs keep being generated for infinity):
Code:
D7 00 00 02 03 E8 01 F4 E7 00 00 00 00 00 00 00
FC 12 16 04 5F FD FF F8 FA 00 00 FF 80 80 80 FF
FB 00 00 00 00 14 50 FF E2 00 00 1C C8 11 20 78
E3 00 10 01 00 00 00 00 FD 90 00 00 06 00 0B 00
F5 90 00 00 07 05 01 41 E6 00 00 00 00 00 00 00
F3 00 00 00 07 07 F4 00 E7 00 00 00 00 00 00 00
F5 88 04 00 00 05 01 41 F2 00 00 00 00 03 C0 3C
D9 00 00 00 00 2F 00 05 01 02 00 40 06 00 7D 28
06 00 02 04 00 04 02 06 06 04 08 0D 0A 00 06 08
04 06 0C 0E 10 00 0E 12 10 06 0E 14 12 00 0E 16
14 06 0E 18 FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
Linux Data (actual data):
Code:
D7 00 00 02 03 E8 01 F4 E7 00 00 00 00 00 00 00
FC 12 16 04 5F FD FF F8 FA 00 00 FF 80 80 80 FF
FB 00 00 00 00 14 50 FF E2 00 00 1C C8 11 20 78
E3 00 10 01 00 00 00 00 FD 90 00 00 06 00 0B 00
F5 90 00 00 07 05 01 41 E6 00 00 00 00 00 00 00
F3 00 00 00 07 07 F4 00 E7 00 00 00 00 00 00 00
F5 88 04 00 00 05 01 41 F2 00 00 00 00 03 C0 3C
D9 00 00 00 00 2F 00 05 01 02 00 40 06 00 7D 28
06 00 02 04 00 04 02 06 06 04 08 0A 00 06 08 04
06 0C 0E 10 00 0E 12 10 06 0E 14 12 00 0E 16 14
06 0E 18 1A 00 1C 0E 1A 06 0E 1E 18 00 0E 0C 1E
06 1E 20 18 00 1E 22 20 06 22 24 20 00 22 26 24
06 26 28 24 00 28 2A 24 06 2C 2E 26 00 2C 30 2E
06 2A 32 24 00 34 14 36 06 14 16 36 00 10 36 0C
06 10 34 36 00 2C 32 30 06 38 2C 22 00 2C 26 22
06 3A 38 1E 00 38 22 1E 06 3C 3A 36 00 3C 36 3E
06 3A 1E 36 00 1E 0C 36 D9 00 00 00 00 2F 04 05
06 10 12 14 00 10 14 34 E7 00 00 00 00 00 00 00
FB 00 00 00 8A 14 5A FF FD 90 00 00 06 00 0B 00
F5 90 00 00 07 05 01 40 E6 00 00 00 00 00 00 00
F3 00 00 00 07 07 F4 00 E7 00 00 00 00 00 00 00
F5 88 04 00 00 05 01 40 F2 00 00 00 00 03 C0 3C
D9 00 00 00 00 2F 00 05 01 01 40 28 06 00 7B E8
06 00 02 04 00 00 06 02 06 08 06 00 00 0A 08 00
06 0C 0E 10 00 0E 12 10 06 0E 14 12 00 14 16 12
06 14 18 16 00 18 1A 16 06 12 1C 1E 00 12 16 1C
06 16 20 1C 00 16 1A 20 06 10 12 1E 00 10 1E 0C
06 18 22 1A 00 18 24 22 06 1A 26 20 00 26 24 20
DF 00 00 00 00 00 00 00
Is there a way to "free" variables each time during the loop that I don't know of? Thanks in advance!