comparison Python/errors.c @ 17275:e510c4cc5737 2.0

Use Py_CHARMASK for ctype macros. Fixes bug #232787.
author Moshe Zadka <moshez@math.huji.ac.il>
date Sat, 31 Mar 2001 07:33:56 +0000
parents a2fcc487b9da
children
comparison
equal deleted inserted replaced
17274:6dc43e0c6bbf 17275:e510c4cc5737
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;