Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

snprintf not working correctly

$
0
0

Hi,

I'm using snprintf to create a char * with data inserted in string format. I came back to the project I was working on, and all of a sudden, my working code was no longer working.

Here's what I have:

size = snprintf(message, 40, "ADC1 = %5u\tADC0 = %5u\tLUX = %4.4f", ADC1Value, ADC0Value,
				luxValue(ADC0Value, ADC1Value));

Now, what I'd expect would to be see each of those values, tab separated. Instead, I'm seeing:

ADC1 = u        ADC0 = u        LUX = .4f

I think this is relatively bizarre, considering this was working code at one point. The only changes I can note is that the compiler had updated from 4.3.* to 4.4.*, however when I tried using 4.3.*, it still did not work.

Thanks for the help,

Ethan


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>