aboutsummaryrefslogtreecommitdiffstats
path: root/missing
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-13 12:41:29 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-13 12:41:29 +0000
commita22df39467709c4f270f45fbdfb0b548156bd633 (patch)
treeed9a2f5e1ccedafb2a4cb40dbd212d2c5c8755ad /missing
parentcb4133c8abc7f7d20d3046bd62f862aef216c5a9 (diff)
downloadruby-a22df39467709c4f270f45fbdfb0b548156bd633.tar.gz
* missing/ffs.c (ffs): fixed for non-zero values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/ffs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/missing/ffs.c b/missing/ffs.c
index 1a1189968a..bad99cf116 100644
--- a/missing/ffs.c
+++ b/missing/ffs.c
@@ -6,11 +6,13 @@
int ffs(int arg)
{
unsigned int x = (unsigned int)arg;
- int r = 0;
+ int r;
if (x == 0)
return 0;
+ r = 1;
+
#if 32 < SIZEOF_INT * CHAR_BIT
if ((x & 0xffffffff) == 0) {
x >>= 32;