In errorSystemSetContext(), return immediately on pre-4.0.0.

This commit is contained in:
yellows8 2019-03-27 21:16:27 -04:00
parent 68e3204a88
commit 6be5ad949e
2 changed files with 3 additions and 1 deletions

View File

@ -161,7 +161,7 @@ void errorSystemSetLanguageCode(ErrorSystemConfig* c, u64 LanguageCode);
/**
* @brief Sets the ErrorContext.
* @note Only available on [4.0.0+], on older versions \ref errorSystemShow will skip pushing the storage for this.
* @note Only available on [4.0.0+], on older versions this will return without setting the context.
* @param c ErrorSystemConfig struct.
* @param ctx ErrorContext, NULL to clear it.
*/

View File

@ -185,6 +185,8 @@ void errorSystemSetLanguageCode(ErrorSystemConfig* c, u64 LanguageCode) {
}
void errorSystemSetContext(ErrorSystemConfig* c, ErrorContext* ctx) {
if (hosversionBefore(4,0,0)) return;
c->arg.hdr.contextFlag = ctx!=0;
memset(&c->ctx, 0, sizeof(ErrorContext));
if (ctx) memcpy(&c->ctx, ctx, sizeof(ErrorContext));