From 16e602617d194c65ac641d1835bab6c58503cdcc Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 14 Sep 2008 11:21:44 -0700 Subject: Use strncmp for filtering records It's faster, and there's no chance of ever having false positives -- not that it was actually going to happen in this case, because we would never find a colon elsewhere in the line. But code gets copied around and changes over time. --- src/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index a2dc4ce0..f19cc3d3 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2137,7 +2137,7 @@ static void create_stored_records_from_keys(char *key, char *value, uint8_t *pdata; char tmp[3] = ""; - if (strstr(key, addr) == NULL) + if (strncmp(key, addr, 17)) return; size = strlen(value)/2; -- cgit