X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lib%2Fext2fs%2Fdirhash.c;h=4ba3f35c091f2deff7db96f3bd367c25154c070a;hb=e97319e259ab48257bdde1ba4e4bbfab9548579f;hp=a06970698b35a574c3d59f55b73d0d3e43d26acf;hpb=543547a52a20cb7e69d74921b2f691078fd55d83;p=tools%2Fe2fsprogs.git diff --git a/lib/ext2fs/dirhash.c b/lib/ext2fs/dirhash.c index a069706..4ba3f35 100644 --- a/lib/ext2fs/dirhash.c +++ b/lib/ext2fs/dirhash.c @@ -11,6 +11,7 @@ * %End-Header% */ +#include "config.h" #include #include @@ -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) {