| 307 | } |
| 308 | |
| 309 | void FilereaderLp::writeToFile(FILE* file, const char* format, ...) { |
| 310 | va_list argptr; |
| 311 | va_start(argptr, format); |
| 312 | std::array<char, LP_MAX_LINE_LENGTH + 1> stringbuffer = {}; |
| 313 | HighsInt tokenlength = |
| 314 | vsnprintf(stringbuffer.data(), stringbuffer.size(), format, argptr); |
| 315 | va_end(argptr); |
| 316 | if (this->linelength + tokenlength >= LP_MAX_LINE_LENGTH) { |
| 317 | fprintf(file, "\n"); |
| 318 | fprintf(file, "%s", stringbuffer.data()); |
| 319 | this->linelength = tokenlength; |
| 320 | } else { |
| 321 | fprintf(file, "%s", stringbuffer.data()); |
| 322 | this->linelength += tokenlength; |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | void FilereaderLp::writeToFileLineEnd(FILE* file) { |
| 327 | fprintf(file, "\n"); |
no test coverage detected