<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Generating log file using debug commands problem with LPC1768</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/30266/generating-log-file-using-debug-commands-problem-with-lpc1768</link><description> 
Hello. 

 
My name is Gennadii, some time ago I was FPGA HW\SW developer, but
I had to switch to embedded programming. Now my task is to perform
some test on NXP LPC1768 Cortex M3 using IBM Rational Test Realtime
Studio 8.0 and Keil 4.50.0.0. The problem</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Generating log file using debug commands problem with LPC1768</title><link>https://community.arm.com/thread/68197?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2013 10:54:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bbfa288a-a347-4c6b-8096-b66b7266938d</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
You should follow the instructions and use the PRE tags when
posting your code.&lt;/p&gt;

&lt;p&gt;
But one intersting thing here is:&lt;/p&gt;

&lt;pre&gt;
while(*s &amp;amp;&amp;amp; _bufIdx &amp;lt; BUFSIZE) {
    _u8Rtrt_Buf[_bufIdx++] = *s++;
}
_u8Rtrt_Buf[_bufIdx] = &amp;#39;\0&amp;#39;;
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
Note that the while loop can continue to insert until _bufIdx becomes
BUFSIZE, i.e. indexing the first element after the end of your
buffer.&lt;/p&gt;

&lt;p&gt;
So where do you then write your final &amp;#39;\0&amp;#39;?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>