simplify log func

This commit is contained in:
rofl0r 2012-07-14 17:59:06 +02:00
parent e5e87c8f22
commit 71e15e2edd
2 changed files with 6 additions and 11 deletions

View File

@ -175,21 +175,16 @@ static void encode_base_64(char *src, char *dest, int max_len) {
*dest++ = 0;
}
#define LOG_BUFF 1024*20
int proxychains_write_log(char *str, ...) {
char buff[LOG_BUFF];
void proxychains_write_log(char *str, ...) {
char buff[1024*20];
va_list arglist;
FILE *log_file;
log_file = stderr;
if(!proxychains_quiet_mode) {
va_start(arglist, str);
vsprintf(buff, str, arglist);
vsnprintf(buff, sizeof(buff), str, arglist);
va_end(arglist);
fprintf(log_file, "%s", buff);
fflush(log_file);
fprintf(stderr, "%s", buff);
fflush(stderr);
}
return EXIT_SUCCESS;
}
static int write_n_bytes(int fd, char *buff, size_t size) {

View File

@ -102,7 +102,7 @@ int connect_proxy_chain (int sock, ip_type target_ip, unsigned short target_port
proxy_data * pd, unsigned int proxy_count, chain_type ct,
unsigned int max_chain );
int proxychains_write_log(char *str,...);
void proxychains_write_log(char *str, ...);
typedef int (*connect_t)(int, const struct sockaddr *, socklen_t);
typedef struct hostent* (*gethostbyname_t)(const char *);