1
0
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:
kris
2007-08-14 06:46:54 +00:00
parent 9f41f69d1b
commit 0b50c16b38
23 changed files with 174 additions and 176 deletions

View File

@@ -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);