avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] sprintf


From: David VanHorn
Subject: Re: [avr-gcc-list] sprintf
Date: Thu, 26 Feb 2009 22:08:22 -0500



> I solved my problem by inserting the null with
>  memset((A_String+16), 0, 1); and the same for B_String.

A_String[16] = 0;

would be a much more efficient way of performing the same operation.
 
Interesting.. I would expect this to result in a loop writing out a bunch of zeroes.
 
I'm going to play with this some more tomorrow when I'm not tired, and see if I can make sense of how the strings are getting munged.
It makes sense to plant the trailing zero on every write by sprintf, and that does seem to fit with the symptoms.
 
I was thinking that it was ONLY writing the char I gave it.
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]