Re: [Quickfix-developers] Found checksum problem
Brought to you by:
orenmnero
From: Oren M. <ore...@ya...> - 2003-07-29 15:58:57
|
Yes, this was actually fixed in the repository a couple of weeks ago. Here is the patch: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/quickfix/quickfix/src/C++/Field.h.diff?r1=1.6&r2=1.7 --- Jo Janssens <jo...@tr...> wrote: > I found the cause of my checksum problem: the > setString() function on > the field class does not reset the m_total member > before adding to it: > > void setString( const std::string& string ) > { > m_string = string; > m_data = IntConvertor::convert(m_field) + "=" + > string + "\001"; > m_length = m_data.length(); > const char* iter = m_data.c_str(); > const char* end = iter + m_data.length(); > while( iter != end ) > m_total += *iter++; > } > > My suggestion is that a line be added as such: > > void setString( const std::string& string ) > { > m_string = string; > m_data = IntConvertor::convert(m_field) + "=" + > string + "\001"; > m_length = m_data.length(); > const char* iter = m_data.c_str(); > const char* end = iter + m_data.length(); > m_total = 0; > while( iter != end ) > m_total += *iter++; > } > > Jo Janssens > Telluride Asset Management > > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |