mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
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:
parent
6a52857f8f
commit
67fcc9b5af
16 changed files with 31 additions and 29 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue