comparison Python/errors.c @ 16997:86fd723f2928 legacy-trunk

Use Py_CHARMASK for ctype macros. Fixes bug #232787.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 06 Mar 2001 12:12:02 +0000
parents 2d4da6cfee61
children 3fc06c1149a4 6a2e2548e6cf
comparison
equal deleted inserted replaced
16996:41b9249e4d48 16997:86fd723f2928
400 400
401 n = 0; 401 n = 0;
402 for (f = format; *f; f++) { 402 for (f = format; *f; f++) {
403 if (*f == '%') { 403 if (*f == '%') {
404 const char* p = f; 404 const char* p = f;
405 while (*++f && *f != '%' && !isalpha(*f)) 405 while (*++f && *f != '%' && !isalpha(Py_CHARMASK(*f)))
406 ; 406 ;
407 switch (*f) { 407 switch (*f) {
408 case 'c': 408 case 'c':
409 (void) va_arg(vargs, int); 409 (void) va_arg(vargs, int);
410 /* fall through... */ 410 /* fall through... */
455 if (*f == '%') { 455 if (*f == '%') {
456 const char* p = f++; 456 const char* p = f++;
457 /* parse the width.precision part (we're only 457 /* parse the width.precision part (we're only
458 interested in the precision value, if any) */ 458 interested in the precision value, if any) */
459 n = 0; 459 n = 0;
460 while (isdigit(*f)) 460 while (isdigit(Py_CHARMASK(*f)))
461 n = (n*10) + *f++ - '0'; 461 n = (n*10) + *f++ - '0';
462 if (*f == '.') { 462 if (*f == '.') {
463 f++; 463 f++;
464 n = 0; 464 n = 0;
465 while (isdigit(*f)) 465 while (isdigit(Py_CHARMASK(*f)))
466 n = (n*10) + *f++ - '0'; 466 n = (n*10) + *f++ - '0';
467 } 467 }
468 while (*f && *f != '%' && !isalpha(*f)) 468 while (*f && *f != '%' && !isalpha(Py_CHARMASK(*f)))
469 f++; 469 f++;
470 switch (*f) { 470 switch (*f) {
471 case 'c': 471 case 'c':
472 *s++ = va_arg(vargs, int); 472 *s++ = va_arg(vargs, int);
473 break; 473 break;