[Dip] Fix for the bug in 0.82.1
Ted Ralphs
ted at lehigh.edu
Sun Oct 9 00:53:09 EDT 2011
There is now a new release 0.82.2 that fixes this bug and a number of
others.
Cheers,
Ted
On Tue, Sep 13, 2011 at 5:22 AM, Shahin Gelareh <shahin.gelareh at gmail.com>wrote:
>
> Hi,
>
> The current function "UtilStrToLower" in 0.82.1 crashes because my compiler
> (VS2010 C++) does not see '\0' at the end of string.
> Formerly it could be fixed by using :
> //
> ------------------------------------------------------------------------- //
> // returns a lower case version of the std::string in-place
> inline std::string & UtilStrToLower(std::string & s) {
> // Purify did not like this version:
> // transform (s.begin(), s.end(), s.begin(), myToLower());
> if(s.size() == 0)
> return s;
> std::transform(s.begin(), s.end(),
> s.begin(),std::ptr_fun<int,int>(std::tolower));
> //int i;
> //for (i = 0; s[i] != '\0'; i++)
> // s[i] = static_cast<char>(tolower(s[i]));
> return s;
> }
>
> instead.
>
> Some changes seem to have been done from 0.82.0 to 0.82.1 which have tried
> to force C-type strings. With this change the above function does not
> compile because "tolower" is not longer recognized to be in the scope of
> STD.
> The fix is now to use:
>
> //
> ------------------------------------------------------------------------- //
> // returns a lower case version of the std::string in-place
> inline std::string & UtilStrToLower(std::string & s) {
> // Purify did not like this version:
> // transform (s.begin(), s.end(), s.begin(), myToLower());
> if(s.size() == 0)
> return s;
> std::transform(s.begin(), s.end(),
> s.begin(),std::ptr_fun<int,int>tolower));
> //int i;
> //for (i = 0; s[i] != '\0'; i++)
> // s[i] = static_cast<char>(tolower(s[i]));
> return s;
> }
>
> This works fine.
>
> regards,
> Shahin
>
>
> _______________________________________________
> Dip mailing list
> Dip at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/dip
>
--
Dr. Ted Ralphs
Associate Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/dip/attachments/20111009/5b66ffca/attachment.html>
More information about the Dip
mailing list