summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-06-03 17:43:38 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-06-03 17:43:38 +0100
commit12cf761503833b3fce2b202df50ec31f12642a2e (patch)
tree7ab4a537a54701a03e261a8edbf13fc3b2208178
parentdcc27345372eba5d957fbcdfbe2bef0f8e66269a (diff)
Tidying: coverity issues
-rw-r--r--src/exim_monitor/em_queue.c18
-rw-r--r--src/src/queue.c9
-rw-r--r--src/src/spool_in.c4
3 files changed, 15 insertions, 16 deletions
diff --git a/src/exim_monitor/em_queue.c b/src/exim_monitor/em_queue.c
index 893e43898..103e63dd4 100644
--- a/src/exim_monitor/em_queue.c
+++ b/src/exim_monitor/em_queue.c
@@ -656,32 +656,30 @@ if (jread != NULL)
been delivered, and removing visible names. In the nonrecipients tree,
domains are lower cased. */
-if (recipients_list != NULL)
- {
+if (recipients_list)
for (i = 0; i < recipients_count; i++)
{
uschar *pp;
uschar *r = recipients_list[i].address;
tree_node *node = tree_search(tree_nonrecipients, r);
- if (node == NULL)
+ if (!node)
{
uschar temp[256];
uschar *rr = temp;
- Ustrcpy(temp, r);
- while (*rr != 0 && *rr != '@') rr++;
- while (*rr != 0) { *rr = tolower(*rr); rr++; }
+ Ustrncpy(temp, r, sizeof(temp));
+ while (*rr && *rr != '@') rr++;
+ while (*rr) { *rr = tolower(*rr); rr++; }
node = tree_search(tree_nonrecipients, temp);
}
- if ((pp = strstric(r+1, qualify_domain, FALSE)) != NULL &&
- *(--pp) == '@') *pp = 0;
- if (node == NULL)
+ if ((pp = strstric(r+1, qualify_domain, FALSE)) && *(--pp) == '@')
+ *pp = 0;
+ if (!node)
(void)find_dest(p, r, dest_add, FALSE);
else
(void)find_dest(p, r, dest_remove, FALSE);
}
- }
/* We also need to scan the tree of non-recipients, which might
contain child addresses that are not in the recipients list, but
diff --git a/src/src/queue.c b/src/src/queue.c
index f53759c43..1b7b9f74c 100644
--- a/src/src/queue.c
+++ b/src/src/queue.c
@@ -1378,7 +1378,6 @@ switch(action)
}
if (yield)
- {
if (spool_write_header(id, SW_MODIFYING, &errmsg) >= 0)
printf("has been modified\n");
else
@@ -1386,7 +1385,6 @@ switch(action)
yield = FALSE;
printf("- while %s: %s\n", doing, errmsg);
}
- }
break;
}
@@ -1394,8 +1392,11 @@ switch(action)
/* Closing the datafile releases the lock and permits other processes
to operate on the message (if it still exists). */
-(void)close(deliver_datafile);
-deliver_datafile = -1;
+if (deliver_datafile >= 0)
+ {
+ (void)close(deliver_datafile);
+ deliver_datafile = -1;
+ }
return yield;
}
diff --git a/src/src/spool_in.c b/src/src/spool_in.c
index 7eb42907c..915798784 100644
--- a/src/src/spool_in.c
+++ b/src/src/spool_in.c
@@ -63,8 +63,8 @@ for (i = 0; i < 2; i++)
if (i == 0) continue;
if (!queue_running)
log_write(0, LOG_MAIN, "Spool%s%s file %s-D not found",
- *queue_name ? " Q=" : "",
- *queue_name ? queue_name : "",
+ *queue_name ? US" Q=" : US"",
+ *queue_name ? queue_name : US"",
id);
}
else