changeset 1191:c3235828de9a release-4.0

irccd: fix some style
author David Demelier <markand@malikania.fr>
date Thu, 09 Mar 2023 12:47:15 +0100
parents 91a783779a32
children 43e3f7a4045b
files lib/irccd/subst.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lib/irccd/subst.c	Thu Mar 09 12:45:22 2023 +0100
+++ b/lib/irccd/subst.c	Thu Mar 09 12:47:15 2023 +0100
@@ -214,19 +214,19 @@
 {
 	FILE *fp;
 	size_t written;
+	char *end;
 
 	/* Accept silently. */
 	if (!(fp = popen(key, "r")))
 		return;
 
 	/*
-	 * Since we cannot determine the number of bytes that must be read, read until the end of
-	 * the output string and cut at the number of bytes read if lesser.
+	 * Since we cannot determine the number of bytes that must be read,
+	 * read until the end of the output string and cut at the number of
+	 * bytes read if lesser.
 	 */
 	if ((written = fread(*out, 1, *outsz - 1, fp)) > 0) {
 		/* Remove '\r\n' */
-		char *end;
-
 		if ((end = memchr(*out, '\r', written)) || (end = memchr(*out, '\n', written)))
 			*end = '\0';
 		else
@@ -330,9 +330,8 @@
 static int
 substitute(const char **p, char **out, size_t *outsz, const struct irc_subst *subst)
 {
-	char key[64] = {0};
+	char key[64] = {0}, *end;
 	size_t keysz;
-	char *end;
 	int replaced = 1;
 
 	if (!**p)
@@ -436,6 +435,7 @@
 		if (!is_reserved(*i)) {
 			if (ccat(&o, &outsz, *i++) < 0)
 				goto err;
+
 			continue;
 		}