src/SDL_error.c
branchSDL-1.2
changeset 11972 0b5ac2b90ab1
parent 11971 70dd6a38cd76
     1.1 --- a/src/SDL_error.c	Sat Mar 24 22:39:46 2018 +0300
     1.2 +++ b/src/SDL_error.c	Sat Mar 24 22:41:17 2018 +0300
     1.3 @@ -68,6 +68,17 @@
     1.4  			    case 0:  /* Malformed format string.. */
     1.5  				--fmt;
     1.6  				break;
     1.7 +			    case 'l':
     1.8 +				switch (*fmt++) {
     1.9 +				case 0:  /* Malformed format string.. */
    1.10 +					--fmt;
    1.11 +					break;
    1.12 +				case 'i': case 'd': case 'u':
    1.13 +					error->args[error->argc++].value_l =
    1.14 +								va_arg(ap, long);
    1.15 +					break;
    1.16 +				}
    1.17 +				break;
    1.18  			    case 'c':
    1.19  			    case 'i':
    1.20  			    case 'd':
    1.21 @@ -139,6 +150,21 @@
    1.22  				while ( (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) && spot < (tmp+SDL_arraysize(tmp)-2) ) {
    1.23  					*spot++ = *fmt++;
    1.24  				}
    1.25 +				if (*fmt == 'l') {
    1.26 +					*spot++ = *fmt++;
    1.27 +					*spot++ = *fmt++;
    1.28 +					*spot++ = '\0';
    1.29 +					switch (spot[-2]) {
    1.30 +					case 'i': case 'd': case 'u':
    1.31 +						len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_l);
    1.32 +						if (len > 0) {
    1.33 +						    msg += len;
    1.34 +						    maxlen -= len;
    1.35 +						}
    1.36 +						break;
    1.37 +					}
    1.38 +					continue;
    1.39 +				}
    1.40  				*spot++ = *fmt++;
    1.41  				*spot++ = '\0';
    1.42  				switch (spot[-2]) {