From: Martin Willi Date: Fri, 10 Dec 2010 13:25:19 +0000 (+0100) Subject: Use strncaseeq instead of strncasecmp X-Git-Tag: 4.5.1~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7f7a0ba062f1f294cc84d1e3f3b35fe234054ec;p=thirdparty%2Fstrongswan.git Use strncaseeq instead of strncasecmp --- diff --git a/src/conftest/actions.c b/src/conftest/actions.c index 71e172833e..e66e9d7f12 100644 --- a/src/conftest/actions.c +++ b/src/conftest/actions.c @@ -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; diff --git a/src/conftest/conftest.c b/src/conftest/conftest.c index 304cacf02d..0c1690ab06 100644 --- a/src/conftest/conftest.c +++ b/src/conftest/conftest.c @@ -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); diff --git a/src/conftest/hooks/add_notify.c b/src/conftest/hooks/add_notify.c index 00833265f9..de46ca81f8 100644 --- a/src/conftest/hooks/add_notify.c +++ b/src/conftest/hooks/add_notify.c @@ -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); diff --git a/src/conftest/hooks/add_payload.c b/src/conftest/hooks/add_payload.c index 845d512aa0..03a47cc235 100644 --- a/src/conftest/hooks/add_payload.c +++ b/src/conftest/hooks/add_payload.c @@ -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); diff --git a/src/conftest/hooks/unencrypted_notify.c b/src/conftest/hooks/unencrypted_notify.c index 8737158ada..80bdc64b7a 100644 --- a/src/conftest/hooks/unencrypted_notify.c +++ b/src/conftest/hooks/unencrypted_notify.c @@ -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);