[PATCH 13/65] stylistic fixes

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Wed, 16 Apr 2014 19:40:06 +0200

Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
---
 ii.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/ii.c b/ii.c
index 073e6ff..1e22dc2 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -42,8 +42,8 @@ static char msg[IRC_MSG_MAX] =3D ""; /* message buf used =
for communication */
 static void
 usage(void) {
 	eprintf("ii-" VERSION ", =C2=A9 2005-2014 ii engineers, see LICENSE for d=
etails\n"
-	      "usage: %s <-s host> [-i <irc dir>] [-p <port>]\n"
-	      "          [-n <nick>] [-k <password>] [-f <fullname>]\n", argv0);
+		    "usage: %s <-s host> [-i <irc dir>] [-p <port>]\n"
+		    "          [-n <nick>] [-k <password>] [-f <fullname>]\n", argv0);
 }
=20
 static char *
_AT_@ -110,14 +110,14 @@ static void
 add_channel(char *cname) {
 	Channel *c;
 	int fd;
-	char *name =3D striplower(cname);
+	char *name;
=20
+	name =3D striplower(cname);
 	for(c =3D channels; c; c =3D c->next)
 		if(!strcmp(name, c->name))
 			return; /* already handled */
=20
-	fd =3D open_channel(name);
-	if(fd =3D=3D -1)
+	if((fd =3D open_channel(name)) =3D=3D -1)
 		eprintf("exiting, cannot create in channel: %s:", name);
=20
 	if(!(c =3D calloc(1, sizeof(Channel))))
_AT_@ -138,7 +138,7 @@ rm_channel(Channel *c) {
 	Channel *p;
=20
 	if(channels =3D=3D c)
-		channels =3D channels->next;
+		channels =3D channels->next; /* first item */
 	else {
 		for(p =3D channels; p && p->next !=3D c; p =3D p->next);
 		if(p->next =3D=3D c)
_AT_@ -505,15 +505,14 @@ run(int fd, char *host) {
 int
 main(int argc, char *argv[]) {
 	struct passwd *spw;
-	long port =3D SERVER_PORT;
 	char *key =3D NULL, *fullname =3D NULL, *host =3D "";
 	char prefix[_POSIX_PATH_MAX];
+	long port =3D SERVER_PORT;
 	int ircfd;
=20
-	/* use nickname of user and homedir for irc running ii by default */
+	/* use nickname and home dir of user for ii by default */
 	if(!(spw =3D getpwuid(getuid())))
 		eprintf("getpwuid() failed:");
-
 	strlcpy(nick, spw->pw_name, sizeof(nick));
 	snprintf(prefix, sizeof(prefix), "%s/irc", spw->pw_dir);
=20
_AT_@ -529,7 +528,7 @@ main(int argc, char *argv[]) {
 			host =3D EARGF(usage());
 			break;
 		case 'p':
-			port =3D estrtol(EARGF(usage()),  10);
+			port =3D estrtol(EARGF(usage()), 10);
 			break;
 		case 'n':
 			strlcpy(nick, EARGF(usage()), sizeof(nick));
--=20
2.4.10
--Multipart=_Mon__9_May_2016_17_21_10_+0200_I.6cpFVydhq75aaE
Content-Type: text/x-diff;
 name="0014-initialize-some-variables.patch"
Content-Disposition: attachment;
 filename="0014-initialize-some-variables.patch"
Content-Transfer-Encoding: 7bit
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Mon May 09 2016 - 17:24:22 CEST