summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-15 07:48:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-15 07:48:47 +0000
commit9a24232fd28baa60a4a460b2fc70a538b746bca0 (patch)
tree0271f0e93347e90c82031366dc666f7f93838370 /pack.c
parentcb944528b6e73eb220d31f487d350e752aef5027 (diff)
* pack.c (pack_unpack): should treat 'U' in character unit, not in
byte unit. * error.c (exc_initialize): should clear backtrace information. * io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd). * rubyio.h: remove FMODE_FDOPEN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack.c b/pack.c
index 33870d28fc..b924c7418d 100644
--- a/pack.c
+++ b/pack.c
@@ -1468,11 +1468,11 @@ pack_unpack(str, fmt)
case 'U':
if (len > send - s) len = send - s;
while (len > 0 && s < send) {
- int alen = len;
+ int alen = send - s;
unsigned long l;
l = utf8_to_uv(s, &alen);
- s += alen; len -= alen;
+ s += alen; len--;
rb_ary_push(ary, rb_uint2inum(l));
}
break;