# HG changeset patch # User David Demelier # Date 1678362435 -3600 # Node ID c3235828de9ac30afd6f9720cc927e8d78dea1a4 # Parent 91a783779a32058ed248bc41422cab3b8f96eedb irccd: fix some style diff -r 91a783779a32 -r c3235828de9a lib/irccd/subst.c --- 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; }