Mark safe_snprintf and safe_vsnprintf as deprecated, remove uses of them

safe_snprintf and safe_vsnprintf just exist to ensure that the resulting strings are always null-terminated. The documentation for snprintf/vsnprintf states that the output of those methods are always null-terminated, thus making the safe versions obsolete.
This commit is contained in:
Tim Wojtulewicz 2019-12-18 15:58:35 -07:00
parent 6a52857f8f
commit 67fcc9b5af
16 changed files with 31 additions and 29 deletions

View file

@ -135,7 +135,7 @@ bool DbgBreakpoint::SetLocation(ParseLocationRec plr, string loc_str)
}
at_stmt = plr.stmt;
safe_snprintf(description, sizeof(description), "%s:%d",
snprintf(description, sizeof(description), "%s:%d",
source_filename, source_line);
debug_msg("Breakpoint %d set at %s\n", GetID(), Description());
@ -148,7 +148,7 @@ bool DbgBreakpoint::SetLocation(ParseLocationRec plr, string loc_str)
loc_str.c_str());
at_stmt = plr.stmt;
const Location* loc = at_stmt->GetLocationInfo();
safe_snprintf(description, sizeof(description), "%s at %s:%d",
snprintf(description, sizeof(description), "%s at %s:%d",
function_name.c_str(), loc->filename, loc->last_line);
debug_msg("Breakpoint %d set at %s\n", GetID(), Description());
@ -171,7 +171,7 @@ bool DbgBreakpoint::SetLocation(Stmt* stmt)
AddToGlobalMap();
const Location* loc = stmt->GetLocationInfo();
safe_snprintf(description, sizeof(description), "%s:%d",
snprintf(description, sizeof(description), "%s:%d",
loc->filename, loc->last_line);
debug_msg("Breakpoint %d set at %s\n", GetID(), Description());