Skip to content

Commit

Permalink
Warnings cleanup: delete unused variables, add execvpe
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickxia committed Oct 24, 2020
1 parent b0c87ca commit 3ab6b43
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions my_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ int socket(int domain, int type, int protocol) {
}

int (*og_socket)(int,int,int) = dlsym(RTLD_NEXT,"socket");
int (*og_connect)(int, const struct sockaddr *, socklen_t) = dlsym(RTLD_NEXT,"connect");
ssize_t (*og_send)(int,const void*,size_t,int) = dlsym(RTLD_NEXT,"send");
og_socket = dlsym(RTLD_NEXT,"socket");
og_connect = dlsym(RTLD_NEXT,"connect");

if ( (type == SOCK_STREAM) && (domain == AF_INET)) {
struct addrinfo *socks_info = get_socks_addr(socks_h,socks_p);
Expand Down Expand Up @@ -77,11 +74,9 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
if (buffer[1] != 0) {
return -1;
}
int i;

char r_res[256],*req;
char req_res[10];


req=r_res;
*(req++)=5;
Expand Down
1 change: 1 addition & 0 deletions socksify.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//socksify.c
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
Expand Down

0 comments on commit 3ab6b43

Please sign in to comment.