@@ -70,7 +70,7 @@ static size_t
70
70
digit_span (const char * s , const char * e )
71
71
{
72
72
size_t i = 0 ;
73
- while (s + i < e && isdigit (s [i ])) i ++ ;
73
+ while (s + i < e && isdigit (( unsigned char ) s [i ])) i ++ ;
74
74
return i ;
75
75
}
76
76
@@ -110,7 +110,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
110
110
111
111
s = RSTRING_PTR (y );
112
112
ep = RSTRING_END (y );
113
- while (s < ep && !issign (* s ) && !isdigit (* s ))
113
+ while (s < ep && !issign (* s ) && !isdigit (( unsigned char ) * s ))
114
114
s ++ ;
115
115
if (s >= ep ) goto no_date ;
116
116
bp = s ;
@@ -162,7 +162,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
162
162
163
163
s = RSTRING_PTR (y );
164
164
ep = RSTRING_END (y );
165
- while (s < ep && !issign (* s ) && !isdigit (* s ))
165
+ while (s < ep && !issign (* s ) && !isdigit (( unsigned char ) * s ))
166
166
s ++ ;
167
167
if (s >= ep ) goto no_year ;
168
168
bp = s ;
@@ -199,7 +199,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
199
199
200
200
s = RSTRING_PTR (m );
201
201
ep = RSTRING_END (m );
202
- while (s < ep && !isdigit (* s ))
202
+ while (s < ep && !isdigit (( unsigned char ) * s ))
203
203
s ++ ;
204
204
if (s >= ep ) goto no_month ;
205
205
bp = s ;
@@ -225,7 +225,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
225
225
226
226
s = RSTRING_PTR (d );
227
227
ep = RSTRING_END (d );
228
- while (s < ep && !isdigit (* s ))
228
+ while (s < ep && !isdigit (( unsigned char ) * s ))
229
229
s ++ ;
230
230
if (s >= ep ) goto no_mday ;
231
231
bp = s ;
@@ -364,9 +364,9 @@ static int
364
364
str_end_with_word (const char * s , long l , const char * w )
365
365
{
366
366
int n = (int )strlen (w );
367
- if (l <= n || !isspace (s [l - n - 1 ])) return 0 ;
367
+ if (l <= n || !isspace (( unsigned char ) s [l - n - 1 ])) return 0 ;
368
368
if (strncasecmp (& s [l - n ], w , n )) return 0 ;
369
- do ++ n ; while (l > n && isspace (s [l - n - 1 ]));
369
+ do ++ n ; while (l > n && isspace (( unsigned char ) s [l - n - 1 ]));
370
370
return n ;
371
371
}
372
372
@@ -376,7 +376,7 @@ shrunk_size(const char *s, long l)
376
376
long i , ni ;
377
377
int sp = 0 ;
378
378
for (i = ni = 0 ; i < l ; ++ i ) {
379
- if (!isspace (s [i ])) {
379
+ if (!isspace (( unsigned char ) s [i ])) {
380
380
if (sp ) ni ++ ;
381
381
sp = 0 ;
382
382
ni ++ ;
@@ -394,7 +394,7 @@ shrink_space(char *d, const char *s, long l)
394
394
long i , ni ;
395
395
int sp = 0 ;
396
396
for (i = ni = 0 ; i < l ; ++ i ) {
397
- if (!isspace (s [i ])) {
397
+ if (!isspace (( unsigned char ) s [i ])) {
398
398
if (sp ) d [ni ++ ] = ' ' ;
399
399
sp = 0 ;
400
400
d [ni ++ ] = s [i ];
@@ -754,8 +754,8 @@ check_year_width(VALUE y)
754
754
l = RSTRING_LEN (y );
755
755
if (l < 2 ) return 0 ;
756
756
s = RSTRING_PTR (y );
757
- if (!isdigit (s [1 ])) return 0 ;
758
- return (l == 2 || !isdigit (s [2 ]));
757
+ if (!isdigit (( unsigned char ) s [1 ])) return 0 ;
758
+ return (l == 2 || !isdigit (( unsigned char ) s [2 ]));
759
759
}
760
760
761
761
static int
0 commit comments