This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS v5.1 sprintf stdio funtion error



When porting my CCSv4.2 code to CCSv5.1, I noticed a possible bug in the sprintf function. when I do

char buffer[LARGE_ENOUGH_SIZE];

sprintf(buffer, "prompt: %d", a_int_num);

I have only one digit correct, all the following digits are 0xFFs

e.g. if the a_int_num is 5, I got the string "prompt: 5" which is correct;

if the a_int_num is 456, I got the string "prompt: 4\FF\FF", so the second and third digits, instead of ascii code of '5' and '6', the buffer content at those location are 0xFF.

it doesn't matter the width option, if I use "%3d", %ld, I have the same error

however, all floating point formats are OK, if I use %g, %f, %5.2f, etc. those formats are all correct, just the integars formating results are wrong.

Everything worked in CCSv4.24

Is this a possible bug, or I did something wrong? I used full printf support option.