Commit 68d70c1f authored by rbsec's avatar rbsec

Replace strnstr and memmem with strstr for portability

parent d479f856
......@@ -542,18 +542,10 @@ int tcpConnect(struct sslCheckOptions *options)
if (!readOrLogAndClose(socketDescriptor, buffer, BUFFERSIZE, options))
return 0;
#ifdef __USE_GNU
if (memmem(buffer, BUFFERSIZE, ok, sizeof(ok))) {
#else
if (strnstr(buffer, ok, BUFFERSIZE)) {
#endif
if (strstr(buffer, ok)) {
printf_verbose("STARTLS LDAP setup complete.\n");
}
#ifdef __USE_GNU
else if (memmem(buffer, BUFFERSIZE, unsupported, sizeof(unsupported))) {
#else
else if (strnstr(buffer, unsupported, BUFFERSIZE)) {
#endif
else if (strstr(buffer, unsupported)) {
printf_error("%sSTARTLS LDAP connection to %s:%d failed with '%s'.%s\n",
COL_RED, options->host, options->port, unsupported, RESET);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment