instead of using perror() use printf(). Removes ugly and useless error codes. While here move function to *.c

This commit is contained in:
Björn Ketelaars
2015-09-04 17:08:09 +02:00
parent 880e5edf1b
commit 36f8df2011
2 changed files with 7 additions and 1 deletions

View File

@@ -387,6 +387,12 @@ void startup_message()
printf("====================================\n");
}
void error(char *buffer)
{
printf("%s\n", buffer);
exit(1);
}
void parse_parameters(int argc, char **argv)
{
int c;

View File

@@ -80,7 +80,7 @@ int create_directory(char *slug);
int check_protocol(char *buffer);
void bind_to_port(int listen_socket, struct sockaddr_in serveraddr);
void error(char *error_code){perror(error_code); exit(1);}
void error(char *buffer);
void perform_connection(int listen_socket);
void generate_url(char *buffer, char *slug, size_t slug_length, struct client_data data);
void save_to_file(char *buffer, char *slug, struct client_data data);