Fixed crash with SDL_SetError(NULL)
authorSam Lantinga <slouken@libsdl.org>
Sat, 07 Jun 2014 17:31:50 -0700
changeset 88395ba49d7a39a0
parent 8838 b50a84131dc9
child 8840 9b6ddcbdea65
Fixed crash with SDL_SetError(NULL)
src/stdlib/SDL_string.c
     1.1 --- a/src/stdlib/SDL_string.c	Sat Jun 07 17:25:56 2014 -0700
     1.2 +++ b/src/stdlib/SDL_string.c	Sat Jun 07 17:31:50 2014 -0700
     1.3 @@ -1468,6 +1468,9 @@
     1.4      size_t left = maxlen;
     1.5      char *textstart = text;
     1.6  
     1.7 +    if (!fmt) {
     1.8 +        fmt = "";
     1.9 +    }
    1.10      while (*fmt) {
    1.11          if (*fmt == '%') {
    1.12              SDL_bool done = SDL_FALSE;