Commit Graph

8 Commits

Author SHA1 Message Date
Guy Harris
79a3be33a8 Get rid of useless test.
The test was always useless, but, as Coverity apparently didn't realize
that isdigit() returns true only for '0'-'9', it didn't notice until we
used ND_ASCII_ISDIGIT() instead.

Addresses Coverity CID 1453475.
2019-09-03 11:34:15 -07:00
Guy Harris
9a6a650241 Don't use <ctype.h> macros.
Some of them are locale-dependent, and all of them run the risk of
failing if you hand them a char with the 8th bit set.

Move our replacements to a new netdissect-ctype.h file, and, for the
ones that check for particular character types, add _ASCII to the name,
to indicate that only ASCII characters pass the check.  Do the same for
the ones that map between cases, to indicate that they only map ASCII
letters.

For isspace(), explicitly check for the characters we care about, to
make it clearer what we're doing.
2019-09-01 16:11:32 -07: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
Denis Ovsienko
1a2d21409f Remove a duplicate #define. 2017-09-13 13:36:55 +01:00
Guy Harris
7345e3760d Get rid of last uses of/mentions of u_intN_t.
It's now all C99-style uintN_t.
2016-10-06 02:20:25 -07:00
Guy Harris
e075e99150 We only handle 4-part addresses.
Get rid of the code to handle everything else; that code was dead, as
Coverity noted.  Add some comments to clarify what's going on.
2015-11-18 13:29:57 -08:00
Guy Harris
11f73ad248 Don't require IPv6 library support in order to support IPv6 addresses.
Have our own routines to convert between IPv4/IPv6 addresses and
strings; that helps if, for example, we want to build binary versions of
tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't
have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do.  It
also means that we don't require IPv6 library support on UN*X to print
addresses (if somebody wants to build tcpdump for older UN*Xes lacking
IPv6 support in the system library or in add-on libraries).

Get rid of files in the missing directory that we don't need, and
various no-longer-necessary autoconf tests.
2015-09-17 14:56:44 -07:00