Whamcloud - gitweb
e2fsck: fix project quota support
[tools/e2fsprogs.git] / lib / ext2fs / badblocks.c
index 5eb28b7..0f23983 100644 (file)
@@ -9,6 +9,7 @@
  * %End-Header%
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
 #if HAVE_UNISTD_H
@@ -177,7 +178,7 @@ int ext2fs_u32_list_find(ext2_u32_list bb, __u32 blk)
                return high;
 
        while (low < high) {
-               mid = (low+high)/2;
+               mid = ((unsigned)low + (unsigned)high)/2;
                if (mid == low || mid == high)
                        break;
                if (blk == bb->list[mid])