Pops up a dialog box to display a message
| 234 | |
| 235 | // Pops up a dialog box to display a message |
| 236 | void OutrageMessageBox(const char *str, ...) { |
| 237 | char buf[BUF_LEN]; |
| 238 | std::va_list arglist; |
| 239 | int nchars; |
| 240 | |
| 241 | va_start(arglist, str); |
| 242 | nchars = std::vsnprintf(buf, BUF_LEN, str, arglist); |
| 243 | va_end(arglist); |
| 244 | |
| 245 | if (nchars >= BUF_LEN) |
| 246 | Debug_MessageBox(OSMBOX_OK, Messagebox_title, |
| 247 | "The dialog that follows this one overflowed its text buffer. The program may crash."); |
| 248 | |
| 249 | Debug_MessageBox(OSMBOX_OK, Messagebox_title, buf); |
| 250 | } |
| 251 | |
| 252 | int OutrageMessageBox(int type, const char *str, ...) { |
| 253 | char buf[BUF_LEN]; |
no test coverage detected