/*] Copyright (c) 2009-2010, Charles McGarvey [************************** **] All rights reserved. * * vi:ts=4 sw=4 tw=75 * * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * **************************************************************************/ #include #include #include #include "Typesetter.hh" void Typesetter::print(const std::string& format, ...) { va_list args; char buffer[4096]; int nPrinted; va_start(args, format); buffer[0] = '\0'; nPrinted = vsnprintf(buffer, sizeof(buffer), format.c_str(), args); va_end(args); nPrinted = std::min(nPrinted, (int)sizeof(buffer) - 1); }