src/SDL_error.c
changeset 5766 8cc2ae74cd83
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
equal deleted inserted replaced
5765:f4ed7142727a 5766:8cc2ae74cd83
    53 SDL_SetError(const char *fmt, ...)
    53 SDL_SetError(const char *fmt, ...)
    54 {
    54 {
    55     va_list ap;
    55     va_list ap;
    56     SDL_error *error;
    56     SDL_error *error;
    57 
    57 
       
    58     /* Ignore call if invalid format pointer was passed */
       
    59     if (fmt == NULL) return;
       
    60     
    58     /* Copy in the key, mark error as valid */
    61     /* Copy in the key, mark error as valid */
    59     error = SDL_GetErrBuf();
    62     error = SDL_GetErrBuf();
    60     error->error = 1;
    63     error->error = 1;
    61     SDL_strlcpy((char *) error->key, fmt, sizeof(error->key));
    64     SDL_strlcpy((char *) error->key, fmt, sizeof(error->key));
    62 
    65