Use strpfx() helper where appropriate
This commit is contained in:
@@ -112,7 +112,7 @@ METHOD(fetcher_t, fetch, status_t,
|
||||
status_t status = FAILED;
|
||||
chunk_t *result = userdata;
|
||||
|
||||
if (!strneq(url, "ldap", 4))
|
||||
if (!strpfx(url, "ldap"))
|
||||
{
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
@@ -666,7 +666,7 @@ mysql_database_t *mysql_database_create(char *uri)
|
||||
conn_t *conn;
|
||||
private_mysql_database_t *this;
|
||||
|
||||
if (!strneq(uri, "mysql://", 8))
|
||||
if (!strpfx(uri, "mysql://"))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ sqlite_database_t *sqlite_database_create(char *uri)
|
||||
/**
|
||||
* parse sqlite:///path/to/file.db uri
|
||||
*/
|
||||
if (!strneq(uri, "sqlite://", 9))
|
||||
if (!strpfx(uri, "sqlite://"))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ static sshkey_public_key_t *parse_public_key(chunk_t blob)
|
||||
BUILD_RSA_MODULUS, n, BUILD_RSA_PUB_EXP, e, BUILD_END);
|
||||
}
|
||||
else if (format.len > strlen(ECDSA_PREFIX) &&
|
||||
strneq(format.ptr, ECDSA_PREFIX, strlen(ECDSA_PREFIX)))
|
||||
strpfx(format.ptr, ECDSA_PREFIX))
|
||||
{
|
||||
chunk_t ec_blob, identifier, q, oid, encoded;
|
||||
sshkey_public_key_t *key;
|
||||
|
||||
Reference in New Issue
Block a user