Re: [Quickfix-developers] Rawdata field
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2005-06-01 05:19:59
|
Caleb's patch has been checked into CVS along with a unit test based on =
your code.
--oren
----- Original Message -----=20
From: Alexey Zubko=20
To: Caleb Epstein=20
Cc: qui...@li...=20
Sent: Tuesday, May 31, 2005 11:15 AM
Subject: Re: [Quickfix-developers] Rawdata field
Caleb,
Thank you. The patch solved the problem.
P.S.
Misspelling: reinterpret_cast
Regards,
Alexey Zubko
Caleb Epstein wrote:=20
On 5/31/05, Alexey Zubko <ale...@in...> wrote:
Enclosed are the logs.
=20
I actually get crashes trying to send the last message in that
outgoing file (the one with the 0xA4 bytes in RawData). It looks.
like the CheckSum calculation gets messed up by high-bit ASCII
characters and goes negative, which is out-of-spec. This patch fixes
the problem.
diff -u -b -u -p -r1.18 Field.h=20
--- Field.h 28 Dec 2004 15:23:26 -0000 1.18=20
+++ Field.h 31 May 2005 15:44:37 -0000=20
@@ -121,7 +121,10 @@ private:=20
m_length =3D m_data.length();=20
}=20
=20
- const char* iter =3D m_data.c_str();=20
+ // Treat strings as unsigned in case values contain high-bit=20
+ // chars. Don't want checksum to go negative.=20
+ const unsigned char* iter =3D=20
+ reintepret_cast<const unsigned char*> (m_data.c_str());=20
m_total =3D std::accumulate( iter, iter + m_length, 0 );=20
=20
m_calculated =3D true;=20
|