Skip to content

Make function parameters const where appropriate #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chap06/web_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void parse_url(char *url, char **hostname, char **port, char** path) {
}


void send_request(SOCKET s, char *hostname, char *port, char *path) {
void send_request(SOCKET s, const char *hostname, const char *port, const char *path) {
char buffer[2048];

sprintf(buffer, "GET /%s HTTP/1.1\r\n", path);
Expand All @@ -90,7 +90,7 @@ void send_request(SOCKET s, char *hostname, char *port, char *path) {
}


SOCKET connect_to_host(char *hostname, char *port) {
SOCKET connect_to_host(const char *hostname, const char *port) {
printf("Configuring remote address...\n");
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
Expand Down
4 changes: 2 additions & 2 deletions chap09/https_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void parse_url(char *url, char **hostname, char **port, char** path) {
}


void send_request(SSL *s, char *hostname, char *port, char *path) {
void send_request(SSL *s, const char *hostname, const char *port, const char *path) {
char buffer[2048];

sprintf(buffer, "GET /%s HTTP/1.1\r\n", path);
Expand All @@ -89,7 +89,7 @@ void send_request(SSL *s, char *hostname, char *port, char *path) {
}


SOCKET connect_to_host(char *hostname, char *port) {
SOCKET connect_to_host(const char *hostname, const char *port) {
printf("Configuring remote address...\n");
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
Expand Down