summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--client.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/client.c b/client.c
index eaa8555..4bb1f54 100644
--- a/client.c
+++ b/client.c
@@ -46,15 +46,10 @@ struct Client {
 };
 
 struct Client *clientAlloc(struct tls *tls) {
-	struct Client *client = malloc(sizeof(*client));
-	if (!client) err(EX_OSERR, "malloc");
-
-	client->error = false;
+	struct Client *client = calloc(1, sizeof(*client));
+	if (!client) err(EX_OSERR, "calloc");
 	client->tls = tls;
 	client->need = NeedNick | NeedUser | (clientPass ? NeedPass : 0);
-	client->serverTime = false;
-	client->len = 0;
-
 	return client;
 }
 
@@ -185,12 +180,7 @@ static const struct {
 
 static void clientParse(struct Client *client, char *line) {
 	struct Message msg = parse(line);
-	if (!msg.cmd) {
-		// FIXME: Identify client in message.
-		warnx("no command");
-		client->error = true;
-		return;
-	}
+	if (!msg.cmd) return;
 	for (size_t i = 0; i < ARRAY_LEN(Handlers); ++i) {
 		if (strcmp(msg.cmd, Handlers[i].cmd)) continue;
 		Handlers[i].fn(client, msg);
090f356f&follow=1'>List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe