Index: src/svg/path-string.cpp =================================================================== --- src/svg/path-string.cpp (Revision 22416) +++ src/svg/path-string.cpp (Arbeitskopie) @@ -125,12 +125,10 @@ } void Inkscape::SVG::PathString::State::appendNumber(double v, int precision, int minexp) { - size_t const reserve = precision+1+1+1+1+3; // Just large enough to hold the maximum number of digits plus a sign, a period, the letter 'e', another sign and three digits for the exponent - size_t const oldsize = str.size(); - str.append(reserve, (char)0); - char* begin_of_num = const_cast(str.data()+oldsize); // Slightly evil, I know (but std::string should be storing its data in one big block of memory, so...) - size_t added = sp_svg_number_write_de(begin_of_num, v, precision, minexp); - str.resize(oldsize+added); // remove any trailing characters + size_t const reserve = precision+1+1+1+1+1+3; // Just large enough to hold the maximum number of digits plus a dot, a sign, a period, the letter 'e', another sign and three digits for the exponent + char* float_buffer[reserve + 1]; + size_t added = sp_svg_number_write_de(float_buffer, v, precision, minexp); + str.append(float_buffer, added); // remove any trailing characters } void Inkscape::SVG::PathString::State::appendNumber(double v, double &rv, int precision, int minexp) {