summaryrefslogtreecommitdiffstats
path: root/src/basic/macro.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-10-22 14:57:41 +0200
committerGitHub <noreply@github.com>2020-10-22 14:57:41 +0200
commite1da60e430e881b3d8d40e5b1ab36bda3ed5a054 (patch)
treeb33bb3c7e962d3ee7d4844b4fa89a066aec9cded /src/basic/macro.h
parenttest-env-util: Verify that \r is disallowed in env var values (diff)
parentresolvectl: wrap the extended status string too (diff)
downloadsystemd-e1da60e430e881b3d8d40e5b1ab36bda3ed5a054.tar.xz
systemd-e1da60e430e881b3d8d40e5b1ab36bda3ed5a054.zip
Merge pull request #17324 from keszybz/resolvectl-compat-output
resolvectl compat output
Diffstat (limited to 'src/basic/macro.h')
-rw-r--r--src/basic/macro.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/macro.h b/src/basic/macro.h
index d0ddb369ca..cffc5ec59c 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -650,4 +650,8 @@ static inline int __coverity_check_and_return__(int condition) {
_copy; \
})
+static inline size_t size_add(size_t x, size_t y) {
+ return y >= SIZE_MAX - x ? SIZE_MAX : x + y;
+}
+
#include "log.h"