fgets() saving a skipping line char, not skipping inputs : <p>I know there is questions dealing with skipping inputs for <code>fgets()</code>; however i have not found any help with this problem online or asking friends around.</p>

<p>I use:</p>

<pre><code>fgets(tdataMplMsgStrng0_au8, 100, fpread);
</code></pre>

<p>to read a string from a text file and assign it to the string <code>tdataMplMsgStrng0_au8</code>. I have many <code>fgets()</code> before and after this and none are skipping data; however the others are all are converted to integers afterwards, like below:</p>

<pre><code>fgets(temp_s32, 100, fpread);
sint32 tCILXIOD_dataMplMsgDisp4To0_u32 = atoi(temp_s32);
</code></pre>

<p>The problem is when i print this string to a text file it skips an extra line (besides the \n) that none of the others in the same format do:</p>

<pre><code>fprintf(fp, "%s\n", tdataMplMsgStrng0_au8);
</code></pre>

<p>I printed each character in the string and noticed it has a "skipped line" as the character for the last char. I also see a char, 14 and onward, that i am not familiar with.</p>

<p>The code to print to command window:</p>

<pre><code>    for (int i = 0; i &lt; 100; i++)
    {
        printf("\n String[%d]: '%c'", i, tdataMplMsgStrng0_au8[i]);
    }
</code></pre>

<p>The output on the command window (Note the text file contains "0jkhjkhkkljh" for the line that sets <code>tdataMplMsgStrng0_au8</code>):</p>

<pre><code>String[0]: '0'
String[1]: 'j'
String[2]: 'k'
String[3]: 'h'
String[4]: 'j'
String[5]: 'k'
String[6]: 'h'
String[7]: 'k'
String[8]: 'k'
String[9]: 'l'
String[10]: 'j'
String[11]: 'h'
String[12]: '
'
String[13]: ' '
String[14]: '|['
String[15]: '|['
String[16]: '|['
</code></pre>

<p>Any help understanding why the "skipping line" char in index 12 is there would be supper helpful. Also just for extra info, it would be nice to know why '|[' is there when i did not enter.</p>
