From 5b2853501539d5b080a0b413abaf64b76876500f Mon Sep 17 00:00:00 2001 From: Eric Gontier Date: Thu, 14 May 2015 07:26:58 +0200 Subject: [PATCH] Change smus_diff declaration : can be a negative value and needs to be initalize to zero. --- fast_strstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_strstr.c b/fast_strstr.c index f5144e5..21f7675 100644 --- a/fast_strstr.c +++ b/fast_strstr.c @@ -60,7 +60,7 @@ char *fast_strstr(const char *haystack, const char *needle) const char *i_haystack = haystack + 1 , *i_needle = needle + 1; - unsigned int sums_diff = *haystack; + int sums_diff = 0; bool identical = true; while (*i_haystack && *i_needle) {