File tree 1 file changed +3
-7
lines changed 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -73,26 +73,22 @@ void set_test_response(const char *buffer) {
73
73
response_buffer_bytes_sent = 0 ;
74
74
}
75
75
76
- const char * test_ip (void ) {
77
- return "1.2.3.4" ;
78
- }
79
-
80
76
void test_init (void ) {
81
77
int inet_pton_result ;
82
78
83
79
inet_ips = malloc (32 );
84
80
last_request = malloc (last_request_size + 1 );
85
81
memset (last_request , 0 , last_request_size + 1 );
86
82
87
- inet_pton_result = inet_pton (AF_INET , test_ip () , inet_ips );
83
+ inet_pton_result = inet_pton (AF_INET , "1.2.3.4" , inet_ips );
88
84
if (inet_pton_result == 0 ) {
89
- printf ("Invalid IP for testing: %s\n" , test_ip () );
85
+ printf ("Invalid IP for testing: %s\n" , "1.2.3.4" );
90
86
exit (1 );
91
87
} else if (inet_pton_result == -1 ) {
92
88
perror ("Invalid address class" );
93
89
exit (1 );
94
90
}
95
- hent = (struct hostent * )malloc (sizeof (struct hostent * ));
91
+ hent = (struct hostent * )malloc (sizeof (struct hostent ));
96
92
97
93
response_buffer = malloc (response_buffer_size + 1 );
98
94
memset (response_buffer , 0 , response_buffer_size + 1 );
You can’t perform that action at this time.
0 commit comments