From 84ca81cdd5c52591b4981205567156f8c140a75e Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Fri, 19 Jun 2015 16:14:27 -0700 Subject: [PATCH] import jneurla's fixes TOASTERS ON FIRE WORLD IN CHAOS ONLY OLEGDB --- src/string_compare_guy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/string_compare_guy.c b/src/string_compare_guy.c index f19760e..19f9cef 100644 --- a/src/string_compare_guy.c +++ b/src/string_compare_guy.c @@ -7,17 +7,17 @@ // right hand side, length and returns 1 if the right hand side (needle) is inside the left hand // side (haystack). static int string_compare_guy(char* lhs, int llength, char* rhs, int rlength) { - char* lnz = alloca(llength + 1); + char lnz[llength + 1]; memcpy(lnz, lhs, llength); lnz[llength] = 0; - char* rnz = alloca(rlength + 1); + char rnz[rlength + 1]; memcpy(rnz, rhs, rlength); rnz[rlength] = 0; - int result = (intptr_t) strstr(lnz, rhs); + char *result = strstr(lnz, rhs); - return result; + return result == NULL ? 0 : 1; } int main() {