summaryrefslogtreecommitdiff
path: root/dix/ffs.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/ffs.c')
-rw-r--r--dix/ffs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dix/ffs.c b/dix/ffs.c
index f84f7b47f..b75657d29 100644
--- a/dix/ffs.c
+++ b/dix/ffs.c
@@ -36,6 +36,8 @@ int
ffs(int i)
{
int j;
+ if (i == 0)
+ return 0;
for (j = 1; (i & 1) == 0; j++)
i >>= 1;
return j;