mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-10 21:39:10 -04:00
more elegant solution: append note to error message
This commit is contained in:
parent
8aa7508716
commit
b93de6f810
@ -76,6 +76,13 @@ void I_ErrorOrSuccess(int err_code, const char *prefix, const char *error, ...)
|
|||||||
|
|
||||||
void I_ErrorMsg()
|
void I_ErrorMsg()
|
||||||
{
|
{
|
||||||
|
const char note[] = "\nNote: This is an error message and not a \"crash\"!";
|
||||||
|
|
||||||
|
if (exit_code != 0 && sizeof(errmsg) - strlen(errmsg) > strlen(note))
|
||||||
|
{
|
||||||
|
strcat(errmsg, note);
|
||||||
|
}
|
||||||
|
|
||||||
//!
|
//!
|
||||||
// @category obscure
|
// @category obscure
|
||||||
//
|
//
|
||||||
@ -87,9 +94,7 @@ void I_ErrorMsg()
|
|||||||
SDL_ShowSimpleMessageBox(exit_code == 0 ?
|
SDL_ShowSimpleMessageBox(exit_code == 0 ?
|
||||||
SDL_MESSAGEBOX_INFORMATION :
|
SDL_MESSAGEBOX_INFORMATION :
|
||||||
SDL_MESSAGEBOX_ERROR,
|
SDL_MESSAGEBOX_ERROR,
|
||||||
exit_code == 0 ?
|
PROJECT_STRING, errmsg, NULL);
|
||||||
PROJECT_STRING :
|
|
||||||
PROJECT_STRING ": Error message (this is not a \"crash\"!)", errmsg, NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user