diff --git a/src/MySQL_Connection.cpp b/src/MySQL_Connection.cpp index 7cbf83a..d50312b 100644 --- a/src/MySQL_Connection.cpp +++ b/src/MySQL_Connection.cpp @@ -58,8 +58,8 @@ const char DISCONNECTED[] PROGMEM = "Disconnected."; Returns boolean - True = connection succeeded */ -boolean MySQL_Connection::connect(IPAddress server, int port, char *user, - char *password, char *db) +boolean MySQL_Connection::connect(IPAddress server, int port, const char *user, + const char *password, const char *db) { int connected = 0; int retries = MAX_CONNECT_ATTEMPTS; diff --git a/src/MySQL_Connection.h b/src/MySQL_Connection.h index 6537b99..1816996 100644 --- a/src/MySQL_Connection.h +++ b/src/MySQL_Connection.h @@ -42,8 +42,8 @@ class MySQL_Connection : public MySQL_Packet { public: MySQL_Connection(Client *client_instance) : MySQL_Packet(client_instance) {} - boolean connect(IPAddress server, int port, char *user, char *password, - char *db=NULL); + boolean connect(IPAddress server, int port, const char *user, const char *password, + const char *db=NULL); int connected() { return client->connected(); } const char *version() { return MYSQL_VERSION_STR; } void close(); diff --git a/src/MySQL_Packet.cpp b/src/MySQL_Packet.cpp index b9c0cf7..0820f3d 100644 --- a/src/MySQL_Packet.cpp +++ b/src/MySQL_Packet.cpp @@ -94,8 +94,8 @@ void MySQL_Packet::show_error(const char *msg, bool EOL) { password[in] password db[in] default database */ -void MySQL_Packet::send_authentication_packet(char *user, char *password, - char *db) +void MySQL_Packet::send_authentication_packet(const char *user, const char *password, + const char *db) { if (buffer != NULL) free(buffer); @@ -175,7 +175,7 @@ void MySQL_Packet::send_authentication_packet(char *user, char *password, Returns boolean - True = scramble succeeded */ -boolean MySQL_Packet::scramble_password(char *password, byte *pwd_hash) { +boolean MySQL_Packet::scramble_password(const char *password, byte *pwd_hash) { byte *digest; byte hash1[20]; byte hash2[20]; diff --git a/src/MySQL_Packet.h b/src/MySQL_Packet.h index 20399f1..135aa80 100644 --- a/src/MySQL_Packet.h +++ b/src/MySQL_Packet.h @@ -63,10 +63,10 @@ class MySQL_Packet { MySQL_Packet(Client *client_instance); boolean complete_handshake(char *user, char *password); - void send_authentication_packet(char *user, char *password, - char *db=NULL); + void send_authentication_packet(const char *user, const char *password, + const char *db=NULL); void parse_handshake_packet(); - boolean scramble_password(char *password, byte *pwd_hash); + boolean scramble_password(const char *password, byte *pwd_hash); void read_packet(); int get_packet_type(); void parse_error_packet();