libfreerdp-utils/pcap: open pcap in binary mode

Use 'b' in fopen's mode string to force binary (untranslated) mode
when reading or writing the pcap file.
This is required on WIN32 and maybe on other non POSIX conforming
systems.

This fixes the mstsc internal error disconnect followed by a crash
of the sample server when latter is used to serve a pcap file on
WIN32.
This commit is contained in:
Norbert Federa 2013-06-25 17:11:36 +02:00
parent 84aa209322
commit 9df9c7d28a

View File

@ -158,7 +158,7 @@ rdpPcap* pcap_open(char* name, BOOL write)
{
rdpPcap* pcap;
FILE* pcap_fp = fopen(name, write ? "w+" : "r");
FILE* pcap_fp = fopen(name, write ? "w+b" : "rb");
if (pcap_fp == NULL)
{