summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/ffs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/string/ffs.c')
-rw-r--r--lib/libc/string/ffs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/string/ffs.c b/lib/libc/string/ffs.c
index f08e0d1..abd2146 100644
--- a/lib/libc/string/ffs.c
+++ b/lib/libc/string/ffs.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#include <strings.h>
/*
- * ffs -- vax ffs instruction
+ * Find First Set bit
*/
int
ffs(int mask)
@@ -50,6 +50,6 @@ ffs(int mask)
if (mask == 0)
return(0);
for (bit = 1; !(mask & 1); bit++)
- mask >>= 1;
- return(bit);
+ (unsigned int)mask >>= 1;
+ return (bit);
}
OpenPOWER on IntegriCloud