From c91ff9668142a9d0aac0bc364ccaf40611fa9c72 Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Thu, 23 Dec 2010 15:54:40 +0100 Subject: Cleaned up code and added -Wall to the compiler flags. Moved packet types over to enums for more ease of use. --- users.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'users.c') diff --git a/users.c b/users.c index 6ae39c8..1c0bb7d 100644 --- a/users.c +++ b/users.c @@ -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) { -- cgit v1.2.3