summaryrefslogtreecommitdiff
path: root/src/src/malware.c
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-12-16 22:24:00 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2019-02-10 23:22:50 +0000
commitd7978c0f8af20ff4c3f770589b1bb81568aecff3 (patch)
tree537a4a88135696e72740ad1c4cde4b7c4a1489c7 /src/src/malware.c
parent40ed89b32412fdab2ca147c27fdb856a5623e382 (diff)
downloadexim4-d7978c0f8af20ff4c3f770589b1bb81568aecff3.tar.gz
Use C99 initialisations for iterators
(cherry picked from commit db3f7b6972f3b003c0413b78afcfbe295ffe0b97)
Diffstat (limited to 'src/src/malware.c')
-rw-r--r--src/src/malware.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/src/malware.c b/src/src/malware.c
index 6adcf9b30..2e783e398 100644
--- a/src/src/malware.c
+++ b/src/src/malware.c
@@ -107,16 +107,16 @@ static struct scan
void
features_malware(void)
{
-const struct scan * sc;
const uschar * s;
uschar * t;
uschar buf[64];
spf(buf, sizeof(buf), US"_HAVE_MALWARE_");
-for (sc = m_scans; sc->scancode != -1; sc++)
+for (const struct scan * sc = m_scans; sc->scancode != -1; sc++)
{
- for(s = sc->name, t = buf+14; *s; s++) if (*s != '-') *t++ = toupper(*s);
+ for (s = sc->name, t = buf+14; *s; s++) if (*s != '-')
+ *t++ = toupper(*s);
*t = '\0';
builtin_macro_create(buf);
}
@@ -898,7 +898,6 @@ badseek: err = errno;
/* "virus(es) found" if virus number is > 0 */
if (drweb_vnum)
{
- int i;
gstring * g = NULL;
/* setup default virus name */
@@ -909,7 +908,7 @@ badseek: err = errno;
drweb_re = m_pcre_compile(drweb_re_str, &errstr);
/* read and concatenate virus names into one string */
- for (i = 0; i < drweb_vnum; i++)
+ for (int i = 0; i < drweb_vnum; i++)
{
int ovector[10*3];
@@ -1044,7 +1043,7 @@ badseek: err = errno;
#ifndef DISABLE_MAL_FSECURE
case M_FSEC: /* "fsecure" scanner type ---------------------------------- */
{
- int i, j, bread = 0;
+ int i, bread = 0;
uschar * file_name;
uschar av_buffer[1024];
static uschar *cmdopt[] = { US"CONFIGURE\tARCHIVE\t1\n",
@@ -1070,7 +1069,7 @@ badseek: err = errno;
return m_panic_defer_3(scanent, CUS callout_address,
string_sprintf("unable to read answer %d (%s)", i, strerror(errno)),
malware_daemon_ctx.sock);
- for (j = 0; j < bread; j++)
+ for (int j = 0; j < bread; j++)
if (av_buffer[j] == '\r' || av_buffer[j] == '\n')
av_buffer[j] ='@';
}
@@ -2282,9 +2281,8 @@ if (!fprot6d_re_virus)
void
malware_show_supported(FILE * f)
{
-struct scan * sc;
fprintf(f, "Malware:");
-for (sc = m_scans; sc->scancode != (scanner_t)-1; sc++) fprintf(f, " %s", sc->name);
+for (struct scan * sc = m_scans; sc->scancode != (scanner_t)-1; sc++) fprintf(f, " %s", sc->name);
fprintf(f, "\n");
}