about summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-30 19:44:45 -0400
committerJune McEnroe <june@causal.agency>2020-03-30 19:44:45 -0400
commitff783628268470acc02e52126d6a357691723fba (patch)
treeafde924a98359080d9fc329ea4bd133e50ee735d /handle.c
parentAdd text macros (diff)
downloadcatgirl-ff783628268470acc02e52126d6a357691723fba.tar.gz
catgirl-ff783628268470acc02e52126d6a357691723fba.zip
Replace some declaration; while loops with for loops
I should have been using this for getopt loops already but the call here
is slightly too long to fit on one line as a for loop.
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/handle.c b/handle.c
index a090ca2..84a2927 100644
--- a/handle.c
+++ b/handle.c
@@ -383,8 +383,7 @@ static void handleNick(struct Message *msg) {
 		set(&self.nick, msg->params[0]);
 		uiRead(); // Update prompt.
 	}
-	uint id;
-	while (None != (id = completeID(msg->nick))) {
+	for (uint id; (id = completeID(msg->nick));) {
 		if (!strcmp(idNames[id], msg->nick)) {
 			set(&idNames[id], msg->params[0]);
 		}
@@ -404,8 +403,7 @@ static void handleNick(struct Message *msg) {
 
 static void handleQuit(struct Message *msg) {
 	require(msg, true, 0);
-	uint id;
-	while (None != (id = completeID(msg->nick))) {
+	for (uint id; (id = completeID(msg->nick));) {
 		urlScan(id, msg->nick, msg->params[0]);
 		uiFormat(
 			id, Cold, tagTime(msg),