mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-21 22:03:46 -07:00
Merge pull request #124 from crondaemon/fix-warnings
Remove some compiler warnings
This commit is contained in:
commit
54633f3c48
3 changed files with 12 additions and 7 deletions
|
@ -322,7 +322,7 @@ void hdrrepv(ptr_header_node * ptr_head, char *hdrname, char *new_value) {
|
||||||
if (cur_ptr->value)
|
if (cur_ptr->value)
|
||||||
strcpy(cur_ptr->value, new_value);
|
strcpy(cur_ptr->value, new_value);
|
||||||
else {
|
else {
|
||||||
hydra_report(stderr, "[ERROR] Out of memory (hdrrepv %d)", strlen(new_value) + 1);
|
hydra_report(stderr, "[ERROR] Out of memory (hdrrepv %lu)", strlen(new_value) + 1);
|
||||||
hydra_child_exit(0);
|
hydra_child_exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ int start_teamspeak(int s, char *ip, int port, unsigned char options, char *misc
|
||||||
strcpy((char *) &teamspeak.login, "");
|
strcpy((char *) &teamspeak.login, "");
|
||||||
|
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
teamspeak.crc = crc32(0L, &teamspeak, sizeof(struct team_speak));
|
teamspeak.crc = crc32(0L, (const Bytef *)&teamspeak, sizeof(struct team_speak));
|
||||||
#else
|
#else
|
||||||
teamspeak.crc = crc32(&teamspeak, sizeof(struct team_speak));
|
teamspeak.crc = crc32(&teamspeak, sizeof(struct team_speak));
|
||||||
#endif
|
#endif
|
||||||
|
|
15
hydra.c
15
hydra.c
|
@ -10,6 +10,11 @@
|
||||||
#include "hydra.h"
|
#include "hydra.h"
|
||||||
#include "bfg.h"
|
#include "bfg.h"
|
||||||
|
|
||||||
|
#ifdef LIBNCURSES
|
||||||
|
#include <curses.h>
|
||||||
|
#include <term.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
extern void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||||
extern void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
extern void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||||
extern void service_ftp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
extern void service_ftp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||||
|
@ -732,7 +737,7 @@ void hydra_restore_write(int print_msg) {
|
||||||
for (j = 0; j < hydra_options.max_use; j++) {
|
for (j = 0; j < hydra_options.max_use; j++) {
|
||||||
memcpy((char *) &hh, hydra_heads[j], sizeof(hydra_head));
|
memcpy((char *) &hh, hydra_heads[j], sizeof(hydra_head));
|
||||||
if (j == 0 && debug) {
|
if (j == 0 && debug) {
|
||||||
printf("[DEBUG] sizeof hydra_head: %d\n", sizeof(hydra_head));
|
printf("[DEBUG] sizeof hydra_head: %lu\n", sizeof(hydra_head));
|
||||||
printf("[DEBUG] memcmp: %d\n", memcmp(hydra_heads[j], &hh, sizeof(hydra_head)));
|
printf("[DEBUG] memcmp: %d\n", memcmp(hydra_heads[j], &hh, sizeof(hydra_head)));
|
||||||
}
|
}
|
||||||
hh.active = 0; // re-enable disabled heads
|
hh.active = 0; // re-enable disabled heads
|
||||||
|
@ -1000,7 +1005,7 @@ void kill_children(int signo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long int countlines(FILE * fd, int colonmode) {
|
unsigned long int countlines(FILE * fd, int colonmode) {
|
||||||
size_t lines = 0;
|
size_t clines = 0;
|
||||||
char *buf = malloc(MAXLINESIZE);
|
char *buf = malloc(MAXLINESIZE);
|
||||||
int only_one_empty_line = 0;
|
int only_one_empty_line = 0;
|
||||||
|
|
||||||
|
@ -1024,10 +1029,10 @@ unsigned long int countlines(FILE * fd, int colonmode) {
|
||||||
if (buf[0] == '\r' || buf[0] == '\n') {
|
if (buf[0] == '\r' || buf[0] == '\n') {
|
||||||
if (only_one_empty_line == 0) {
|
if (only_one_empty_line == 0) {
|
||||||
only_one_empty_line = 1;
|
only_one_empty_line = 1;
|
||||||
lines++;
|
clines++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lines++;
|
clines++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1043,7 @@ unsigned long int countlines(FILE * fd, int colonmode) {
|
||||||
rewind(fp);
|
rewind(fp);
|
||||||
#endif
|
#endif
|
||||||
free(buf);
|
free(buf);
|
||||||
return lines;
|
return clines;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fill_mem(char *ptr, FILE * fd, int colonmode) {
|
void fill_mem(char *ptr, FILE * fd, int colonmode) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue