summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-03-07 09:02:57 +0100
committerGitHub <noreply@github.com>2024-03-07 09:02:57 +0100
commit661ece467a2cdf0d437ff63c382c73ccffd1c560 (patch)
treefc858fa34bfbe034c473a9113eef5690f63ec918
parentUpdate catalog.c - Removing sanity check as there is no need of checking non ... (diff)
parentresolve: disambiguate return statement (diff)
downloadsystemd-661ece467a2cdf0d437ff63c382c73ccffd1c560.tar.xz
systemd-661ece467a2cdf0d437ff63c382c73ccffd1c560.zip
Merge pull request #31664 from bluca/coverity
Coverity fixes
-rw-r--r--src/basic/escape.c2
-rw-r--r--src/resolve/resolved-dns-synthesize.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/escape.c b/src/basic/escape.c
index e7f90a4594..2067be4092 100644
--- a/src/basic/escape.c
+++ b/src/basic/escape.c
@@ -454,7 +454,7 @@ char* octescape(const char *s, size_t len) {
if (len == SIZE_MAX)
len = strlen(s);
- if (len > (SIZE_MAX)-1/4)
+ if (len > (SIZE_MAX - 1) / 4)
return NULL;
t = buf = new(char, len * 4 + 1);
diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c
index 6f483fdf0e..4e079864ec 100644
--- a/src/resolve/resolved-dns-synthesize.c
+++ b/src/resolve/resolved-dns-synthesize.c
@@ -450,7 +450,7 @@ bool shall_synthesize_own_hostname_rrs(void) {
if (r < 0 && r != -ENXIO)
log_debug_errno(r, "Failed to parse $SYSTEMD_RESOLVED_SYNTHESIZE_HOSTNAME: %m");
- return (cached = r != 0);
+ return (cached = (r != 0));
}
int dns_synthesize_answer(