[Coin-lpsolver] Is this bug fixed?

Matthew Saltzman mjs at ces.clemson.edu
Wed Aug 6 22:58:27 EDT 2003


On Wed, 6 Aug 2003, Yiming Yao wrote:

> I've found this bug in a June build, wondering if it's fixed.
>
> File: CoinMpsIO.cpp
>
>
> static void
> convertDouble(int formatType, double value, char outputValue[20],
> 	      const char * name, char outputRow[100])
> {
> ....
> char format[7];
> sprintf(format,"%%12.%df",decimal);
> .....
> }
>
> PROBLEM:
> If decimal = 10, format would be "12.10df" -- requiring 8 bytes to include

Actually, "%12.10f", I believe, but yes, it appears you are correct about
the length.

> '\0' at the end.
>
> SOLUTION:
> Let format be 8 byte long:
>
> char format[8];
> sprintf(format,"%%12.%df",decimal);

I don't recall seeing the report on any of the mailing lists before, but I
just committed the fix.

>
>
>
> _______________________________________________
> Coin-lpsolver mailing list
> Coin-lpsolver at www-124.ibm.com
> http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-lpsolver
>

-- 
		Matthew Saltzman

Clemson University Math Sciences
mjs at clemson.edu
http://www.math.clemson.edu/~mjs



More information about the Clp mailing list