diff options
author | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-12-23 15:54:40 +0100 |
---|---|---|
committer | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-12-23 15:54:40 +0100 |
commit | c91ff9668142a9d0aac0bc364ccaf40611fa9c72 (patch) | |
tree | 980304707df6d5e7820208db017dbfb9ccdf0384 /users.c | |
parent | 20746581ba3e8c6cda0851e47b27528401168247 (diff) | |
download | MAC-Telnet-c91ff9668142a9d0aac0bc364ccaf40611fa9c72.tar.gz MAC-Telnet-c91ff9668142a9d0aac0bc364ccaf40611fa9c72.zip |
Cleaned up code and added -Wall to the compiler flags. Moved packet types over to enums for more ease of use.
Diffstat (limited to 'users.c')
-rw-r--r-- | users.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -27,7 +27,7 @@ struct mt_credentials mt_users[MT_CRED_MAXNUM]; void readUserfile() { FILE *file = fopen(USERSFILE, "r"); - unsigned char line [BUFSIZ]; + char line [BUFSIZ]; int i = 0; if (file == NULL) { @@ -36,11 +36,11 @@ void readUserfile() { } while ( fgets(line, sizeof line, file) ) { - unsigned char *user; - unsigned char *password; + char *user; + char *password; - user = (unsigned char *)strtok(line, ":"); - password = (unsigned char *)strtok(NULL, "\n"); + user = strtok(line, ":"); + password = strtok(NULL, "\n"); if (user == NULL || password == NULL) { continue; @@ -60,7 +60,7 @@ void readUserfile() { fclose(file); } -struct mt_credentials* findUser(unsigned char *username) { +struct mt_credentials* findUser(char *username) { int i = 0; while (i < MT_CRED_MAXNUM && mt_users[i].username[0] != 0) { |