I'm experiencing an odd issue with an application I have developed. It parses data from a file and later writes the required elements in a header for a different file. In Debug mode, it compiles perfectly but when I try to compile it in Release mode it writes the data incorrectly. Is there something different between the two that would alter such basic functionality?
Here's an example of a proper vs. improper conversion.
Note: Both outputs are all on one line but I didn't want to stretch the forum frame so I manually added the redundant breakline - also for clarity.
Debug prints out the following (similar to what is read in from a separate file):
Code:
11 "Input: WOW=True" CAS ADVISE\0
12 "Input: Gear=True" CAS ADVISE\0
13 "Input: Anti-Ice=True" EVENT MESSAGE\0
14 "" IGNORE NONE\0
Release is giving me:
Code:
-591746099 \0
1242140 \0
2011353977 \0
1815843632 \0
The code writing this is an iteration through a type struct vector:
Code:
unsigned char c = 0x0a;
for (j=0; j<19; j++)
{
fprintf(out, "%d %s %s %s%c", Bits[j].Bit,
Bits[j].WarMsg,
Bits[j].Destination,
Bits[j].Type,
c);
}