From 106db76b9de624e6f26f16aa3e81ce94ec2c03ef Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Sun, 6 Jan 2013 03:34:56 +0000 Subject: [PATCH] Use memcmp with strlen for correct_exists (it's a hell of a lot faster) --- correct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/correct.c b/correct.c index 3926441..407d06a 100644 --- a/correct.c +++ b/correct.c @@ -399,7 +399,7 @@ static char **correct_edit(const char *ident) { static int correct_exist(char **array, size_t rows, char *ident) { size_t itr; for (itr = 0; itr < rows; itr++) - if (!strcmp(array[itr], ident)) + if (!memcmp(array[itr], ident, strlen(ident))) return 1; return 0; -- 2.39.2