Refactored all the sprintf to use snprintf instead. (#628)

This commit is contained in:
Steve Karg
2024-04-27 12:41:45 -05:00
committed by GitHub
parent 70c54817fd
commit bb276e2431
46 changed files with 308 additions and 272 deletions
+3 -3
View File
@@ -65,9 +65,9 @@ void debug_printf(const char *format, ...)
BACNET_DATE date;
BACNET_TIME time;
datetime_local(&date, &time, NULL, NULL);
sprintf(stamp_str, "[%02d:%02d:%02d.%03d]: ", time.hour, time.min,
time.sec, time.hundredths * 10);
snprintf(
stamp_str, sizeof(stamp_str), "[%02d:%02d:%02d.%03d]: ", time.hour,
time.min, time.sec, time.hundredths * 10);
va_start(ap, format);
vsprintf(buf, format, ap);
va_end(ap);