Use strncaseeq instead of strncasecmp
authorMartin Willi <martin@revosec.ch>
Fri, 10 Dec 2010 13:25:19 +0000 (14:25 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 5 Jan 2011 15:45:59 +0000 (16:45 +0100)
src/conftest/actions.c
src/conftest/conftest.c
src/conftest/hooks/add_notify.c
src/conftest/hooks/add_payload.c
src/conftest/hooks/unencrypted_notify.c

index 71e1728..e66e9d7 100644 (file)
@@ -273,7 +273,7 @@ static void load_action(settings_t *settings, char *action)
 
        for (i = 0; i < countof(actions); i++)
        {
-               if (strncasecmp(actions[i].name, action, strlen(actions[i].name)) == 0)
+               if (strncaseeq(actions[i].name, action, strlen(actions[i].name)))
                {
                        int delay;
                        char *config;
index 304cacf..0c1690a 100644 (file)
@@ -100,7 +100,7 @@ static bool load_trusted_cert(settings_t *settings, bool trusted)
        {
                certificate_t *cert = NULL;
 
-               if (strcaseeq(key, "x509"))
+               if (strncaseeq(key, "x509"))
                {
                        cert = lib->creds->create(lib->creds, CRED_CERTIFICATE,
                                                        CERT_X509, BUILD_FROM_FILE, value, BUILD_END);
index 0083326..de46ca8 100644 (file)
@@ -80,7 +80,7 @@ METHOD(listener_t, message, bool,
                                return TRUE;
                        }
                }
-               if (strncasecmp(this->data, "0x", 2) == 0)
+               if (strncaseeq(this->data, "0x", 2))
                {
                        data = chunk_skip(chunk_create(this->data, strlen(this->data)), 2);
                        data = chunk_from_hex(data, NULL);
index 845d512..03a47cc 100644 (file)
@@ -98,7 +98,7 @@ METHOD(listener_t, message, bool,
                        }
                        enumerator->destroy(enumerator);
                }
-               if (strncasecmp(this->data, "0x", 2) == 0)
+               if (strncaseeq(this->data, "0x", 2))
                {
                        data = chunk_skip(chunk_create(this->data, strlen(this->data)), 2);
                        data = chunk_from_hex(data, NULL);
index 8737158..80bdc64 100644 (file)
@@ -75,7 +75,7 @@ METHOD(listener_t, ike_updown, bool,
                                return TRUE;
                        }
                }
-               if (strncasecmp(this->data, "0x", 2) == 0)
+               if (strncaseeq(this->data, "0x", 2))
                {
                        data = chunk_skip(chunk_create(this->data, strlen(this->data)), 2);
                        data = chunk_from_hex(data, NULL);