From b854733d518fcd72b14cea5d7fed6512550a3572 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 2 Mar 2012 23:03:32 +0000 Subject: [PATCH] * ext/syck/rubyext.c (mktime_do): use ISDIGIT(). [ruby-core:43060] [Bug #6108] * ext/syck/token.c (sycklex_yaml_utf8): cast as unsigned char. [ruby-core:43060] [Bug #6108] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ ext/syck/rubyext.c | 2 +- ext/syck/token.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4d5b35dbe..e235615ce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Mar 3 08:03:29 2012 Nobuyoshi Nakada + + * ext/syck/rubyext.c (mktime_do): use ISDIGIT(). + [ruby-core:43060] [Bug #6108] + + * ext/syck/token.c (sycklex_yaml_utf8): cast as unsigned char. + [ruby-core:43060] [Bug #6108] + Sat Mar 3 06:57:14 2012 Nobuyoshi Nakada * configure.in (ruby_pc): make configurable. [Bug #6051] diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index 2ab2e49482..92b413dc54 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -277,7 +277,7 @@ mktime_do(VALUE varg) const char *end = ptr + 1; const char *begin = end; ptrdiff_t length; - while ( isdigit( *end ) ) end++; + while ( ISDIGIT( *end ) ) end++; if ((length = (end - begin)) > padding) length = padding; MEMCPY(padded, begin, char, length); usec = strtol(padded, NULL, 10); diff --git a/ext/syck/token.c b/ext/syck/token.c index 0d0d4846ba..3d05527e65 100644 --- a/ext/syck/token.c +++ b/ext/syck/token.c @@ -2361,7 +2361,7 @@ ScalarBlock: { nlDoWhat = NL_KEEP; } - else if ( isdigit( *yyt ) ) + else if ( isdigit( (unsigned char)*yyt ) ) { forceIndent = rb_long2int(strtol( yyt, NULL, 10 )); }