Whamcloud - gitweb
libext2fs: explicitly ignore a possible unlink failure in ext2fs_free_icount
[tools/e2fsprogs.git] / lib / ext2fs / dirhash.c
index a069706..4ba3f35 100644 (file)
@@ -11,6 +11,7 @@
  * %End-Header%
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
 
@@ -153,8 +154,6 @@ static void str2hashbuf(const char *msg, int len, __u32 *buf, int num,
        if (len > num*4)
                len = num * 4;
        for (i=0; i < len; i++) {
-               if ((i % 4) == 0)
-                       val = pad;
                if (unsigned_flag)
                        c = (int) ucp[i];
                else
@@ -217,11 +216,13 @@ errcode_t ext2fs_dirhash(int version, const char *name, int len,
        switch (version) {
        case EXT2_HASH_LEGACY_UNSIGNED:
                unsigned_flag++;
+               /* fallthrough */
        case EXT2_HASH_LEGACY:
                hash = dx_hack_hash(name, len, unsigned_flag);
                break;
        case EXT2_HASH_HALF_MD4_UNSIGNED:
                unsigned_flag++;
+               /* fallthrough */
        case EXT2_HASH_HALF_MD4:
                p = name;
                while (len > 0) {
@@ -235,6 +236,7 @@ errcode_t ext2fs_dirhash(int version, const char *name, int len,
                break;
        case EXT2_HASH_TEA_UNSIGNED:
                unsigned_flag++;
+               /* fallthrough */
        case EXT2_HASH_TEA:
                p = name;
                while (len > 0) {