From 4928543d617e584c847b151c683ba72a0075b07d Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 16 Oct 2012 08:55:03 +0000 Subject: [PATCH] Merge r35953 from ruby_1_8_7. * ext/bigdecimal/bigdecimal.c (VpMemAlloc): Fixes a bug reported by Drew Yao git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@37219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/bigdecimal/bigdecimal.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7fcd4b944b..956d9a0da2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Oct 16 16:51:08 2012 Akinori MUSHA + + * ext/bigdecimal/bigdecimal.c (VpMemAlloc): Fixes a bug reported + by Drew Yao + Tue Oct 16 16:30:50 2012 Akinori MUSHA * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): initialize diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index b3cb59def7..d00d81473c 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2061,11 +2061,11 @@ static int gnAlloc=0; /* Memory allocation counter */ VP_EXPORT void * VpMemAlloc(U_LONG mb) { - void *p = xmalloc((unsigned int)mb); - if(!p) { - VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1); + void *p = xmalloc(mb); + if (!p) { + VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1); } - memset(p,0,mb); + memset(p, 0, mb); #ifdef _DEBUG gnAlloc++; /* Count allocation call */ #endif /* _DEBUG */