Forráskód Böngészése

EMERG: vcc: patch: different declarations

intirain 4 éve
szülő
commit
1f86f48029
3 módosított fájl, 11 hozzáadás és 8 törlés
  1. 1 1
      Makefile
  2. 8 5
      cmd.c
  3. 2 2
      include/vcc/version.h

+ 1 - 1
Makefile

@@ -1,6 +1,6 @@
 VCC_MAJOR 		= 1
 VCC_MINOR 		= 10
-VCC_PATCH 		= 0
+VCC_PATCH 		= 1
 VCC_STR 		= -rc 
 
 VCC_COMPILE_TIME 	= $(shell date)

+ 8 - 5
cmd.c

@@ -66,7 +66,7 @@ int send_msg(char *msg, char *s);
 int send_msg_encrypted(char *msg, char *s);
 int encrypt(char *s);
 
-extern struct klist_node *banned_people;
+extern struct klist_node banned_people;
 extern char usrname[];
 extern int rate;
 extern int current_sid;
@@ -405,7 +405,7 @@ int do_cmd_ban(char *s) {
 
 	people_name = strdup(people_arr);
 
-	for (i = banned_people->next; i != banned_people; i = i->next) {
+	for (i = banned_people.next; i != &banned_people; i = i->next) {
 		if (!strcmp(people_name, i->usrname)) {
 			fprintf(stderr, "User %s is already banned", people_name);
 			free(people_name);
@@ -415,7 +415,8 @@ int do_cmd_ban(char *s) {
 	i = malloc(sizeof(struct klist_node));
 	klist_init(i);
 	i->usrname = people_name;
-	klist_add(banned_people, i);
+	klist_add(&banned_people, i);
+
 	return 0;
 }
 
@@ -430,14 +431,16 @@ int do_cmd_unban(char *s) {
 	fprintf(stderr, "Enter the user to unban: ");
 	scanf("%s", people_name);
 	
-	for (i = banned_people->next; i != banned_people; i = i->next) {
+	for (i = banned_people.next; i != &banned_people; i = i->next) {
 		if (!strcmp(people_name, i->usrname)) {
-			klist_del(banned_people, i);
+			klist_del(&banned_people, i);
 			free(i->usrname);
 			free(i);
+
 			break;
 		}
 	}
+
 	free(people_name);
 	return 0;
 }

+ 2 - 2
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCC_VERSION "VCC 1.10.0 Fri Apr  8 20:41:59 CST 2022 root"
-#define VCC_SEMVER "vcc 1.10.0-rc "
+#define VCC_VERSION "VCC 1.10.1 Fri Apr  8 20:50:19 CST 2022 root"
+#define VCC_SEMVER "vcc 1.10.1-rc "