X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e5ec03a25c981b8df7f81fe6f91deb4879524065..3d932490b826facb568937a1290910a1265267f5:/util.c diff --git a/util.c b/util.c index 3c396a23..32278bf3 100644 --- a/util.c +++ b/util.c @@ -21,19 +21,17 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.76 2002-07-18 00:04:12 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.77 2002-08-01 08:53:37 risso Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include + #include -#include #include #ifdef HAVE_FCNTL_H #include @@ -46,7 +44,6 @@ static const char rcsid[] = #ifdef TIME_WITH_SYS_TIME #include #endif -#include #include "interface.h" @@ -361,7 +358,16 @@ read_infile(char *fname) if (cc < 0) error("read %s: %s", fname, pcap_strerror(errno)); if (cc != buf.st_size) +#ifndef WIN32 error("short read %s (%d != %d)", fname, cc, (int)buf.st_size); +#else +/* Windows seems not to like the final \xa character */ + { + char *pdest; + pdest=strchr( cp, '\xa'); + *pdest=0; + } +#endif WIN32 cp[(int)buf.st_size] = '\0'; return (cp);