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

@ -510,6 +510,7 @@ inline char* safe_strncpy(char* dest, const char* src, size_t n)
return result;
}
ZEEK_DEPRECATED("Remove in v4.1: Use system snprintf instead")
inline int safe_snprintf(char* str, size_t size, const char* format, ...)
{
va_list al;
@ -521,6 +522,7 @@ inline int safe_snprintf(char* str, size_t size, const char* format, ...)
return result;
}
ZEEK_DEPRECATED("Remove in v4.1: Use system vsnprintf instead")
inline int safe_vsnprintf(char* str, size_t size, const char* format, va_list al)
{
int result = vsnprintf(str, size, format, al);