summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-14 08:54:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-14 08:54:21 +0000
commit1f433219918829a6f0afc0f926fc46ea01e3156a (patch)
treecef20281cfd60a4fb8564ac3a144fdebc437610d
parente368a2e15833892697889a55a873fd3431072a74 (diff)
* util.c (ruby_each_words): assume no string exceeds INT_MAX.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--util.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 69af0bdc003..788dd14ddf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Mar 14 17:54:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (ruby_each_words): assume no string exceeds INT_MAX.
+
Sat Mar 14 15:59:04 2009 Tanaka Akira <akr@fsij.org>
* process.c (rb_spawn_internal): use int variable for status.
diff --git a/util.c b/util.c
index 48d403e80c9..99e04e7bf26 100644
--- a/util.c
+++ b/util.c
@@ -3816,7 +3816,7 @@ ruby_each_words(const char *str, void (*func)(const char*, int, void*), void *ar
if (!*str) break;
end = str;
while (*end && !ISSPACE(*end) && *end != ',') end++;
- len = end - str;
+ len = (int)(end - str); /* assume no string exceeds INT_MAX */
(*func)(str, len, arg);
}
}