float initial_temp_setpoint = 60; sprintf( bc_buffer, "\n\rVTM: NOT bc_vap_state_off: bc_cf_auto_vap_standby_enable: NOT bc_vap_standby_warmup_completed: warmup time=INC: setpoint<ALI3_STARTUP_COOL: initial_temp_setpoint from bc_vap_standby_temp=AT_ALI3_STARTUP_COOL_DEF_TEMP=%f",initial_temp_setpoint);
Quote:VTM: NOT bc_vap_state_off: bc_cf_auto_vap_standby_enable: NOT bc_vap_standby_warmup_completed: warmup time=INC: setpoint<ali3_startup_cool: initial_temp_setpoint="" from="" bc_vap_standby_temp="AT_ALI3_STARTUP_COOL_DEF_TEMP=60.000000</blockquote"> I was expecting a crash. I was thinking to fix this by using snprintf, so that memory overflow could be avoided. But that would result in a truncated log. So, i was thinking to increase the size of bc_buffer including a NULL charecter. But as it is a global variable, i am a little apprehensive as i do not want to play with a global data and it could also affect the memory map. Could this behaivour be compiler related? I would request for suggestions. Thanks, Rahul VB What I have tried: I tried out the above code in eclipse and Visual studio, but it prints the entire string and not truncated. I also set a break point to view the data of bc_buffer as below: (x)=bc_buffer[197] char 83 'S' (x)=bc_buffer[198] char 84 'T' (x)=bc_buffer[199] char 65 'A' As you can see above the last charecter is 'A' and no NULL charecter, still it does print the entire string of 223 bytes.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)