mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 10:29:03 +00:00
Adding Snprintf() and Vsnprintf() to nbase/nbase_str.c. This is because of Windows' stupid implementation where it doesn't write a NULL byte at the end of the buffer if the result is truncated. I would've just #defined snprintf and vsnprintf to some wrapper function for Windows, but this doesn't work as libdnet and libpcap (and libpcap includes under mswin32) define snprintf to _snprintf and vsnprintf to _vsnprintf like we do, and through the many defines they end up being available in the Nmap sources. Vsnprintf() uses vsnprintf() (and writes a NULL byte at the end if truncated), and Snprintf uses Vsnprintf().
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
#ifndef PCRE_H
|
||||
#define PCRE_H
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#endif /* WIN32 */
|
||||
#define NSE_PCRELIBNAME "pcre"
|
||||
|
||||
LUALIB_API int luaopen_pcre(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user