I have made some small tolls using fgetc to read from files, for upload purposes. But now I'm having an error I can't figure out...?
I'm using Code:blocks with the GCC.
What happens, I am reading a char at a time in to the array ucDMXTxBuff, which starts off OK. When the pointer for the file is 0x12d, it goes wrong. I reads the byte correct, but it returns a pointer for the file that is now 0x328. In the next cycle it jumps even further, and then some times again it increments with only 1 as I would suppose it should...?
for (uiCounter = 2; uiCounter < DMX_BUF_SIZE; uiCounter++)
ucDMXTxBuff[uiCounter] = iFileCharRead;
iFileCharRead = fgetc(pUploadFile);
if(iFileCharRead == EOF)
EOF_Reached = true;
bPacketFull = true;
ucDMXTxBuff[uiCounter] = 0x00;
Do any one have a clue of what might be the problem...?