src/SDL_error.c
branchSDL-1.2
changeset 11972 0b5ac2b90ab1
parent 11971 70dd6a38cd76
child 13010 a355b476255e
equal deleted inserted replaced
11971:70dd6a38cd76 11972:0b5ac2b90ab1
    65 				++fmt;
    65 				++fmt;
    66 			}
    66 			}
    67 			switch (*fmt++) {
    67 			switch (*fmt++) {
    68 			    case 0:  /* Malformed format string.. */
    68 			    case 0:  /* Malformed format string.. */
    69 				--fmt;
    69 				--fmt;
       
    70 				break;
       
    71 			    case 'l':
       
    72 				switch (*fmt++) {
       
    73 				case 0:  /* Malformed format string.. */
       
    74 					--fmt;
       
    75 					break;
       
    76 				case 'i': case 'd': case 'u':
       
    77 					error->args[error->argc++].value_l =
       
    78 								va_arg(ap, long);
       
    79 					break;
       
    80 				}
    70 				break;
    81 				break;
    71 			    case 'c':
    82 			    case 'c':
    72 			    case 'i':
    83 			    case 'i':
    73 			    case 'd':
    84 			    case 'd':
    74 			    case 'u':
    85 			    case 'u':
   137 				char tmp[32], *spot = tmp;
   148 				char tmp[32], *spot = tmp;
   138 				*spot++ = *fmt++;
   149 				*spot++ = *fmt++;
   139 				while ( (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) && spot < (tmp+SDL_arraysize(tmp)-2) ) {
   150 				while ( (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) && spot < (tmp+SDL_arraysize(tmp)-2) ) {
   140 					*spot++ = *fmt++;
   151 					*spot++ = *fmt++;
   141 				}
   152 				}
       
   153 				if (*fmt == 'l') {
       
   154 					*spot++ = *fmt++;
       
   155 					*spot++ = *fmt++;
       
   156 					*spot++ = '\0';
       
   157 					switch (spot[-2]) {
       
   158 					case 'i': case 'd': case 'u':
       
   159 						len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_l);
       
   160 						if (len > 0) {
       
   161 						    msg += len;
       
   162 						    maxlen -= len;
       
   163 						}
       
   164 						break;
       
   165 					}
       
   166 					continue;
       
   167 				}
   142 				*spot++ = *fmt++;
   168 				*spot++ = *fmt++;
   143 				*spot++ = '\0';
   169 				*spot++ = '\0';
   144 				switch (spot[-2]) {
   170 				switch (spot[-2]) {
   145 				    case '%':
   171 				    case '%':
   146 					*msg++ = '%';
   172 					*msg++ = '%';