summaryrefslogtreecommitdiff
path: root/fuzzy.c
diff options
context:
space:
mode:
Diffstat (limited to 'fuzzy.c')
-rw-r--r--fuzzy.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fuzzy.c b/fuzzy.c
index 83cf3ce..a6e238c 100644
--- a/fuzzy.c
+++ b/fuzzy.c
@@ -159,7 +159,7 @@ static void ssdeep_try_reduce_blockhash(struct ssdeep_context *self) {
static const char *b64 =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static int ssdeep_engine_step(struct ssdeep_context *self, unsigned char c) {
+static void ssdeep_engine_step(struct ssdeep_context *self, unsigned char c) {
size_t h;
unsigned int i;
/* At each character we update the rolling hash and the normal hashes.
@@ -203,15 +203,13 @@ static int ssdeep_engine_step(struct ssdeep_context *self, unsigned char c) {
} else
ssdeep_try_reduce_blockhash(self);
}
- ++self->total_size;
- return 0;
}
static int ssdeep_engine(struct ssdeep_context *self,
const unsigned char *buffer, size_t buffer_size) {
+ self->total_size += buffer_size;
for( ;buffer_size > 0; ++buffer, --buffer_size)
- if(ssdeep_engine_step(self, *buffer) < 0)
- return -1;
+ ssdeep_engine_step(self, *buffer);
return 0;
}