Merge pull request #416 from rmaksimov/misc-fixes

Misc fixes
This commit is contained in:
van Hauser 2019-05-12 19:50:43 +02:00 committed by GitHub
commit a5b2f92284
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -85,7 +85,7 @@ void interrupt() {
/* ----------------- internal functions ----------------- */ /* ----------------- internal functions ----------------- */
int32_t internal__hydra_connect(char *host, int32_t port, int32_t protocol, int32_t type) { int32_t internal__hydra_connect(char *host, int32_t port, int32_t type, int32_t protocol) {
int32_t s, ret = -1, ipv6 = 0, reset_selected = 0; int32_t s, ret = -1, ipv6 = 0, reset_selected = 0;
#ifdef AF_INET6 #ifdef AF_INET6
@ -111,10 +111,10 @@ int32_t internal__hydra_connect(char *host, int32_t port, int32_t protocol, int3
#ifdef AF_INET6 #ifdef AF_INET6
if (ipv6) if (ipv6)
s = socket(AF_INET6, protocol, type); s = socket(AF_INET6, type, protocol);
else else
#endif #endif
s = socket(PF_INET, protocol, type); s = socket(PF_INET, type, protocol);
if (s >= 0) { if (s >= 0) {
if (src_port != 0) { if (src_port != 0) {
int32_t bind_ok = 0; int32_t bind_ok = 0;
@ -580,10 +580,10 @@ int32_t internal__hydra_connect_to_ssl(int32_t socket, char *hostname) {
return socket; return socket;
} }
int32_t internal__hydra_connect_ssl(char *host, int32_t port, int32_t protocol, int32_t type, char *hostname) { int32_t internal__hydra_connect_ssl(char *host, int32_t port, int32_t type, int32_t protocol, char *hostname) {
int32_t socket; int32_t socket;
if ((socket = internal__hydra_connect(host, port, protocol, type)) < 0) if ((socket = internal__hydra_connect(host, port, type, protocol)) < 0)
return -1; return -1;
return internal__hydra_connect_to_ssl(socket, hostname); return internal__hydra_connect_to_ssl(socket, hostname);

View file

@ -2296,11 +2296,11 @@ int main(int argc, char *argv[]) {
break; break;
case 'b': case 'b':
outfile_format_tmp = optarg; outfile_format_tmp = optarg;
if (0==strcasecmp(outfile_format_tmp,"text")) if (strcasecmp(outfile_format_tmp,"text") == 0)
hydra_options.outfile_format = FORMAT_PLAIN_TEXT; hydra_options.outfile_format = FORMAT_PLAIN_TEXT;
else if (0==strcasecmp(outfile_format_tmp,"json")) // latest json formatting. else if (strcasecmp(outfile_format_tmp,"json") == 0) // latest json formatting.
hydra_options.outfile_format = FORMAT_JSONV1; hydra_options.outfile_format = FORMAT_JSONV1;
else if (0==strcasecmp(outfile_format_tmp,"jsonv1")) else if (strcasecmp(outfile_format_tmp,"jsonv1") == 0)
hydra_options.outfile_format = FORMAT_JSONV1; hydra_options.outfile_format = FORMAT_JSONV1;
else { else {
fprintf(stderr, "[ERROR] Output file format must be (text, json, jsonv1)\n"); fprintf(stderr, "[ERROR] Output file format must be (text, json, jsonv1)\n");