​Ismail: could you please post more of your code, especially the definition
of buffer?  Also, do you have the word "float" in your call to stostrf, or
were you just letting us know that "number" is a float?  The type of
"number" should not be in the call to dtostrf().  From some forum posts, it
looks like there may be a bug with dtostrf() when using a float instead of
a double.  Can you try using a double for "number" instead of a float?

All: I haven't used dtostrf() before, but based on my cursory glance at
it's definition, it seems unsafe (in the snprintf vs sprintf sense).  Am I
missing something that would prevent a buffer overflow when using
dtostrf(), or is assumed that the caller knows how to test the length of
the string the double will produce before calling dtostrf()?  Is there a
version of dtostrf() that accepts a max length argument (other than
snprintf)?

73,

~James

On Sat, Jul 15, 2017 at 3:47 PM,
​​
Ismail <ismail6...@gmail.com> wrote:

> hi, i am having difficulty in sending a floating point number to lcd.
>
> i ham using
>
> dtostrf(float number, 5,2, buffer);
> lcdprint(buffer);
>
> but invain
>
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to