Commit Graph

7 Commits

Author SHA1 Message Date
Guy Harris
c499612a7f Add nd_{v}snprintf() routines/wrappers.
Some versions of the MSVC runtime library have a non-C99-compliant
vsnprintf(), which we want to avoid.  On Windows, use snprintf() and
vsnprintf() for VS 2015 and later, where they both exist in
C99-compliant forms, and wrap _{v}snprintf_s() otherwise (they're
guaranteed to do the null termination that we want).
2018-01-29 15:48:55 -08:00
Guy Harris
fb2479d733 Always include <config.h> rather than "config.h".
This can prevent bizarre failures if, for example, you've done a
configuration in the top-level source directory, leaving behind one
config.h file, and then do an out-of-tree build in another directory,
with different configuration options.  This way, we always pick up the
same config.h, in the build directory.
2018-01-21 12:27:28 -08:00
Francois-Xavier Le Bail
513f782ae1 Use quoted include netdissect-stdinc.h instead of angle-bracketed one 2018-01-21 10:28:15 +01:00
Guy Harris
688a79e7cb Use strlcpy(), rather than snprintf(), to avoid null format string warnings.
Include the appropriate headers to declare strlcpy() and snprintf().
2016-08-06 15:05:30 -07:00
Gisle Vanem
c4ae1ca64b add a missing declaration in netdissect.c 2016-08-06 16:29:40 +01:00
Guy Harris
6080cff326 Move more libsmi stuff to netdissect.c.
Have the call to smiLoadModule() be in a nd_load_smi_module() routine.
Have it set a *global* flag indicating whether a module has been loaded;
that's not per-netdissect_options.  Use that global flag in print-snmp.c
- and don't test it once per loop iteration, it's not going to change
while the loop is running.

Have a routine to return the version of the library if we're built with
it or NULL if we're not.

That removes the last of the code that tests USE_LIBSMI or uses libsmi
from tcpdump.c.
2016-08-04 14:35:35 -07:00
Guy Harris
bab54e3e56 Add netdissect.c. 2016-08-04 13:25:04 -07:00