/* This file is part of dvi2bitmap; see README for copyrights and licence */ #include #ifdef HAVE_CSTD_INCLUDE #include #include #include // for strlen #else #include #include #include #endif #include #include #include "DviError.h" DviError::DviError(const char *fmt,...) { char *p = new char[2*STD::strlen(fmt)]; va_list ap; va_start(ap,fmt); STD::vsprintf (p, fmt, ap); va_end(ap); problem_ = p; delete[] p; } void DviError::print() const { STD::cerr << "DVI error: " << problem_ << STD::endl; } void DviBug::print() const { STD::cerr << "BUG: " << problem_ << STD::endl; } DviBug::DviBug(const char *fmt,...) { char *p = new char[2*STD::strlen(fmt)]; va_list ap; va_start(ap,fmt); vsprintf (p, fmt, ap); va_end(ap); problem_ = p; delete[] p; }