Skip to content

Commit

Permalink
MorphOS: fix SDL_VSetError
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 committed Jan 15, 2024
1 parent 528de86 commit 01dc2dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SDL_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
va_start(ap, fmt);
result = SDL_vsnprintf(error->str, error->len, fmt, ap);
va_end(ap);

if (result >= 0 && (size_t)result >= error->len && error->realloc_func) {
size_t len = (size_t)result + 1;
char *str = (char *)error->realloc_func(error->str, len);
if (str) {
error->str = str;
error->len = len;

va_start(ap, fmt);
(void)SDL_vsnprintf(error->str, error->len, fmt, ap);
va_end(ap);
Expand All @@ -69,7 +69,7 @@ SDL_VSetError(const char *fmt, va_list ap)

va_list ap_copy;
int result;
SDL_error *error = SDL_GetErrBuf();
SDL_error *error = SDL_GetErrBuf(SDL_TRUE);

error->error = 1; /* mark error as valid */
va_copy(ap_copy, ap);
Expand Down

0 comments on commit 01dc2dd

Please sign in to comment.