diff options
author | Jurij Smakov <jurij@wooyd.org> | 2006-11-11 14:09:15 +0200 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-11-11 14:13:56 +0200 |
commit | acb5ff4c73ac4d52201d7c421f488e2ead5c8b9c (patch) | |
tree | 398635e5a72abd9679e1dcfd64023bbb5fa2ee2f /dix/ffs.c | |
parent | ca094684196886a4a1c10273049fae0705a3edc2 (diff) |
ffs: handle 0 argument (bug #8968)
Handle an argument of 0 in ffs(), instead of looping indefinitely.
Add an ffs prototype to dix.h, and add includes to ffs.c.
(cherry picked from 34164e551e4c3909322d50b09835ca4ac1d49d68 commit)
Diffstat (limited to 'dix/ffs.c')
-rw-r--r-- | dix/ffs.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |