ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] While writing to a pipe, getting some errorneous extra bytes

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Thu, 05 Jan 2006 22:38:23 +0100
Guy Harris wrote:

John McDermott wrote:

It is possible that stdout is not being set to binmode by ethereal. I do not have a Cygwin system set up with a compiler to test it, but maybe that is at least part of the issue.


Yeah, I was thinking the same thing. I'm not sure how it would cause the extra gunk at the end of each packet, but even if that's *not* the problem, we should be doing that anyway (WinDump does).

Agree, but how to set stdout into binary mode, any examples?

I could have a try if someone tells me how to do it :-)


We should perhaps also not close the FILE * to which we're writing if it's the standard output (I think tcpdump/WinDump are doing that as well).

We're only closing stdout just before we're exiting the program, so this shouldn't be a problem in my eyes.

Regards, ULFL